-
-
Notifications
You must be signed in to change notification settings - Fork 28
Introduce a new workflow to publish automatically new merged changes into main a :latest #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sebastienvermeille
wants to merge
10
commits into
main
Choose a base branch
from
ci/refactore
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c90af10
Create publish-latest.yml
sebastienvermeille 4b0a908
Update Dockerfile
sebastienvermeille 56f311a
test
sebastienvermeille 7b5d08b
test
sebastienvermeille 086a953
test
sebastienvermeille c433c6e
test
sebastienvermeille 6120028
test
sebastienvermeille 415955f
test
sebastienvermeille cc96a93
Merge branch 'main' into ci/refactore
tpanajott 58e8a2f
Update Dockerfile
tpanajott File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: "Publish :latest docker tag" | ||
|
|
||
| # Trigger the workflow on any commit or merge to the main branch | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - ci/refactore # TODO: remove it | ||
|
|
||
| env: | ||
| DOCKER_IMAGE_REGISTRY_PATH: nspanelmanager/nspanelmanager | ||
| DOCKER_TAG: test # TODO: change it after proper testing (after merge) | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Get Git commit timestamps | ||
| run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV | ||
|
|
||
| - name: Set up QEMU (required for Buildx) | ||
| uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 | ||
|
|
||
| - name: Login to DockerHub | ||
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Build and push multi-arch image | ||
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | ||
| with: | ||
| context: . | ||
| file: ./docker/Dockerfile | ||
| # note: platforms list: https://github.com/docker/setup-qemu-action qemu-arm,qemu-aarch64 | ||
| platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7 | ||
| push: true | ||
| tags: ${{ env.DOCKER_IMAGE_REGISTRY_PATH }}:${{ env.DOCKER_TAG }} | ||
| build-args: | | ||
| GITHUB_REF_NAME=${{ github.ref_name }} | ||
| env: | ||
| SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the build is failing because sed uses / to determine different parts of the command. It fails on this command
sed -i "s/%version%/$VERSION/g" docker/web/***/web/templates/footer.htmlwhen trying to update the version shown in the footer, but, because the branch is "ci/refactore" it fails as it tries to parse "refactore" as an option to the sed commandsas persed -i "s/%version%/ci/refactore/g" docker/web/***/web/templates/footer.htmlMy pruposal is to change the sed command tosed -i "s|%version%|$VERSION|g" docker/web/***/web/templates/footer.html(ie. use pipes instead of / as separators, we are much more unlikely to want to have a pipe in the version than a / either way).