-
Notifications
You must be signed in to change notification settings - Fork 6
Add github workflows to test building, build and push images #3
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
Conversation
578e7f4 to
331b135
Compare
|
/cc @Madhu-1 /hold We need quay credentials set in github workflow secrets before merging this pr :) |
will figure this out and add it to github later will merge this one. |
Madhu-1
left a comment
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.
added a generic comment with tag and branch name
.github/workflows/test-build.yaml
Outdated
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build and push sidecar container image |
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.
Build and push the mover container image
.github/workflows/test-build.yaml
Outdated
| push: false | ||
| tags: quay.io/ramendr/ceph-volsync-plugin-operator:latest | ||
|
|
||
| build_operator: |
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.
build_mover
68fc1af to
e49438c
Compare
|
Modified it to a single workflow file that
I'll add workflow to build and push tagged images with artifacts similar to https://github.com/csi-addons/kubernetes-csi-addons/blob/main/.github/workflows/tag-release.yaml in a follow-up pr please take a look |
.github/workflows/build-image.yaml
Outdated
| else | ||
| tag="latest" | ||
| echo "Generated tag: $tag" | ||
| echo "tag=$tag" >> $GITHUB_OUTPUT |
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.
This looks extra we already have latest in if case
.github/workflows/build-image.yaml
Outdated
| - name: Check out the repo | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Generate image tag | ||
| id: tag | ||
| run: | | ||
| if [[ "${{ github.ref_name }}" == "main" ]]; then | ||
| tag="latest" | ||
| echo "Generated tag: $tag" | ||
| echo "tag=$tag" >> $GITHUB_OUTPUT | ||
| elif [[ "${{ github.ref_name }}" == release-* ]]; then | ||
| version=$(echo "${{ github.ref_name }}" | sed 's/release-//') | ||
| tag="v${version}-latest" | ||
| echo "Generated tag: $tag" | ||
| echo "tag=$tag" >> $GITHUB_OUTPUT | ||
| else | ||
| tag="latest" | ||
| echo "Generated tag: $tag" | ||
| echo "tag=$tag" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Login to quay.io | ||
| if: github.event_name == 'push' | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: quay.io | ||
| username: ${{ secrets.QUAY_USERNAME }} | ||
| password: ${{ secrets.QUAY_PASSWORD }} |
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.
you can use composite action to avoid this duplication in all 3 jobs
e49438c to
de09a31
Compare
Used matrix strategy instead to simplify. |
This commit adds workflow to build images to test on pull requests and to build & push images after each pr merge. Signed-off-by: Rakshith R <rar@redhat.com>
de09a31 to
1e50fb4
Compare
Uh oh!
There was an error while loading. Please reload this page.