Merge pull request #410 from HumairAK/stable #2
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
name: Build images for Main branch | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
IMAGE_REPO_DSPO: data-science-pipelines-operator | |
QUAY_ORG: opendatahub | |
QUAY_ID: ${{ secrets.QUAY_ID }} | |
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} | |
SOURCE_BRANCH: main | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Generate Tag | |
shell: bash | |
id: tags | |
run: | | |
commit_sha=${{ github.event.after }} | |
tag=main-${commit_sha:0:7} | |
echo "tag=${tag}" >> $GITHUB_OUTPUT | |
- name: Build Image | |
uses: ./.github/actions/build | |
env: | |
IMG: quay.io/${{ env.QUAY_ORG }}/${{ env.IMAGE_REPO_DSPO }}:${{ steps.tags.outputs.tag }} | |
TARGET_IMAGE_TAG: ${{ steps.tags.outputs.tag }} | |
with: | |
OVERWRITE: true | |
IMAGE_REPO: ${{ env.IMAGE_REPO_DSPO }} | |
DOCKERFILE: Dockerfile | |
GH_REPO: ${{ github.repository }} | |
- name: Tag latest | |
shell: bash | |
env: | |
IMG: quay.io/${{ env.QUAY_ORG }}/${{ env.IMAGE_REPO_DSPO }} | |
NEWEST_TAG: ${{ steps.tags.outputs.tag }} | |
run: | | |
podman tag ${IMG}:${NEWEST_TAG} ${IMG}:latest | |
podman push ${IMG}:latest | |
podman tag ${IMG}:${NEWEST_TAG} ${IMG}:main | |
podman push ${IMG}:main |