-
Notifications
You must be signed in to change notification settings - Fork 4
Add workflow_dispatch to the pipelines to set Docker image tag (suffix) #50
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,11 @@ on: | |
| - docker/debian/Dockerfile* | ||
| - test | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Tag suffix to give the Docker images (e.g. v1.2.3)." | ||
| required: true | ||
| type: string | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
|
|
@@ -18,6 +23,7 @@ defaults: | |
|
|
||
| env: | ||
| CONTAINER_REGISTRY: ghcr.io | ||
| CONTAINER_TAG: ${{ github.event.inputs.tag || 'latest' }} | ||
| BUILDKIT_PROGRESS: plain | ||
| CONAN_VERSION: 2.19.1 | ||
| GCOVR_VERSION: 8.3 | ||
|
|
@@ -137,7 +143,7 @@ jobs: | |
| with: | ||
| images: ${{ env.CONTAINER_IMAGE }} | ||
| tags: | | ||
| type=raw,value=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }} | ||
| type=raw,value=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-${{ env.CONTAINER_TAG }} | ||
| type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha- | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Bronek I did not add the tag here, but am not sufficiently familiar with this action. Should the tag be added here too?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, |
||
| labels: | | ||
| org.opencontainers.image.authors=For inquiries, please use https://${{ github.repository }}/issues | ||
|
|
@@ -253,7 +259,7 @@ jobs: | |
| with: | ||
| images: ${{ env.CONTAINER_IMAGE }} | ||
| tags: | | ||
| type=raw,value=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }} | ||
| type=raw,value=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-${{ env.CONTAINER_TAG }} | ||
| type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha- | ||
| - name: Create manifest list and push | ||
| working-directory: /tmp/digests | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
How to verify we're not pushing the same tag again (completely defeating reproducible builds)?
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.
Good point. I'll add an extra step that performs the check in a bit.
Uh oh!
There was an error while loading. Please reload this page.
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.
What if we make use of git tags for this purpose ?
Although they are not guaranteed to never change, it is something that is rarely done and typically for a very good reason.
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.
I think we've come back full circle then based on our offline conversation. I don't mind using Git tags as Docker tags, as that would simplify the pipelines (can use
on: push: tags), so either way works for me.In the meantime, I added a step that checks if the image exists via
docker manifest inspect.