-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Draft workflow to build & push new release image on-branch-push
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
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,55 @@ | ||
name: Build and push release image of ods-ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- releases/* | ||
|
||
jobs: | ||
build: | ||
name: Build Release Image And Extract Image Tag | ||
runs-on: ubuntu-latest | ||
outputs: | ||
image-tag: ${{ steps.extract_tag.outputs.tag }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to Quay.io | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: Extract Release Tag | ||
id: extract_tag | ||
run: | | ||
echo "tag=release-${GITHUB_REF#refs/heads/releases/}" >> $GITHUB_OUTPUT | ||
- name: Build Release Image With Docker | ||
run: | | ||
docker buildx build \ | ||
--platform linux/amd64 \ | ||
--file ods_ci/build/Dockerfile_interop \ | ||
--tag quay.io/modh/ods-ci:${{ steps.extract_tag.outputs.tag }} \ | ||
--load | ||
push: | ||
name: Push Release Image | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Log in to Quay.io | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: Push Release Image With Docker | ||
run: | | ||
docker push quay.io/modh/ods-ci:${{ needs.build.outputs.image-tag }} |