-
Notifications
You must be signed in to change notification settings - Fork 80
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
workflow proposal #41
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 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,19 @@ | ||
name: Lint and validate Helm chart | ||
on: | ||
pull_request: | ||
types: [opened, reopened, edited] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: 'v3.10.0' | ||
id: install-helm | ||
|
||
- name: Test helm | ||
run: helm template helm-charts/k8s-mediaserver |
This file contains 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,72 @@ | ||
name: Build and Push Image | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
versioning: | ||
name: Check and manage versioning | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_tag: ${{ steps.bump-version.outputs.new_tag || steps.bump-version.outputs.previous_tag }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Bump version and push tag | ||
uses: mathieudutour/[email protected] | ||
id: bump-version | ||
with: | ||
github_token: ${{ secrets.GH_TOKEN }} | ||
default_bump: false | ||
|
||
build_image: | ||
needs: versioning | ||
name: Build and push container images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build Image - x86_64 | ||
id: build-image-x86_64 | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: k8s-mediaserver-operator | ||
tags: latest ${{ needs.versioning.outputs.release_tag }} | ||
containerfiles: | | ||
./Dockerfile | ||
|
||
- name: Build Image - ARM64 | ||
id: build-image-arm64 | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: k8s-mediaserver-operator | ||
tags: latest-arm64 ${{ needs.versioning.outputs.release_tag }}-arm64 | ||
containerfiles: | | ||
./Dockerfile-arm64 | ||
|
||
- name: Push To quay.io | ||
id: push-x86 | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ steps.build-image-x86_64.outputs.image }} | ||
tags: latest ${{ needs.versioning.outputs.release_tag }} | ||
registry: quay.io/kubealex | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_TOKEN }} | ||
|
||
- name: Push To quay.io | ||
id: push-arm64 | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ steps.build-image-arm64.outputs.image }} | ||
tags: latest-arm64 ${{ needs.versioning.outputs.release_tag }}-arm64 | ||
registry: quay.io/kubealex | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_TOKEN }} | ||
|
||
- name: Print image url | ||
run: echo "Images pushed to {{ steps.push-x86.outputs.registry-paths }} and ${{ steps.push-arm64.outputs.registry-paths }}" | ||
|
||
|
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.
The container image would be changing and I don't think we want to overwrite existing image versions, why not generate a new patch version on each push to master?
This way we can stop manually bumping the version in the dockerfile and let Github handle the versionning.
or just remove
default_bump
altogether since it's the default valueThere 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.
Since every PR will need validation and approval, I think it's a good idea to keep control over the version increase and only bump the image if strictly necessary.
In my mind, a change in the README cannot be considered a version bump, or a typo in a description.
We could add a check, like "if the new tag is undefined, don't run the build job" but rebuilding and pushing the image won't affect the existing one.
Adding a variable in the helm chart is, as the image will be different, a new tag must be generated and a new image will be built and pushed.