-
Notifications
You must be signed in to change notification settings - Fork 34
Create branch-based and commit-based images #129
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
Merged
Merged
Changes from all commits
Commits
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
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,56 @@ | ||
| name: release to quay.io | ||
| on: | ||
| push: | ||
| tags: [v*] | ||
|
|
||
| env: | ||
| REGISTRY_USER: netobserv+github_ci | ||
| REGISTRY_PASSWORD: ${{ secrets.QUAY_SECRET }} | ||
| REGISTRY: quay.io/netobserv | ||
| IMAGE: flowlogs-pipeline | ||
|
|
||
| jobs: | ||
| push-image: | ||
| name: push image | ||
| runs-on: ubuntu-20.04 | ||
| strategy: | ||
| matrix: | ||
| go: ['1.17'] | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
| - name: validate tag | ||
| id: validate_tag | ||
| run: | | ||
| tag=`git describe --exact-match --tags 2> /dev/null` | ||
| if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then | ||
| echo "$tag is a valid release tag" | ||
| set -e | ||
| echo "::set-output name=tag::$tag" | ||
| else | ||
| echo "$tag is NOT a valid release tag" | ||
| exit 1 | ||
| fi | ||
| - name: install make | ||
| run: sudo apt-get install make | ||
| - name: set up go 1.x | ||
| uses: actions/setup-go@v2 | ||
| with: | ||
| go-version: ${{ matrix.go }} | ||
| - name: build images | ||
| run: DOCKER_TAG=${{ steps.validate_tag.outputs.tag }} make build-images | ||
| - name: podman login to quay.io | ||
| uses: redhat-actions/podman-login@v1 | ||
| with: | ||
| username: ${{ env.REGISTRY_USER }} | ||
| password: ${{ env.REGISTRY_PASSWORD }} | ||
| registry: quay.io | ||
| - name: push to quay.io | ||
| id: push-to-quay | ||
| uses: redhat-actions/push-to-registry@v2 | ||
| with: | ||
| image: ${{ env.IMAGE }} | ||
| tags: ${{ steps.validate_tag.outputs.tag }} | ||
| registry: ${{ env.REGISTRY }} | ||
| - name: print image url | ||
| run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" | ||
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
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,3 @@ | ||
| ARG BASE_IMAGE=quay.io/netobserv/flowlogs-pipeline:main | ||
| FROM $BASE_IMAGE | ||
| LABEL quay.expires-after=2w |
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.
A question and a suggestion ... we have some of that logic in the version building in the Makfile ... would it make sense to expose that with one a Makefile target instead of writing all this logic here ... maybe move to a script under hack ... I just think that having so much logic inside github action might not be good practice?
This is just a suggestion ... not blocking merge or something like that ,.,., this is good now :-0)
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.
Maybe one downside if we have it in a separate place, it's that the
echo "::set-output name=tag::$tag"command, which is tied to the rest of the github action, would be less visible from the action, so it could be more confusing or error prone if the script is modified. What do you think?