Skip to content

Commit

Permalink
Draft workflow to build & push new release image on-branch-push
Browse files Browse the repository at this point in the history
  • Loading branch information
omrirh committed Jan 15, 2025
1 parent 868ab73 commit f732e78
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release-branch-to-image.yml
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 }}

0 comments on commit f732e78

Please sign in to comment.