Skip to content

Commit

Permalink
GHAction: Build Images on push to master
Browse files Browse the repository at this point in the history
  • Loading branch information
gmfrasca committed Nov 17, 2023
1 parent 9ba0751 commit ae62f34
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build images for Master branch
on:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
env:
QUAY_ORG: gmfrasca
QUAY_ID: ${{ secrets.QUAY_ROBOT_USERNAME }}
QUAY_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }}
SOURCE_BRANCH: master
jobs:
build-master-images:
continue-on-error: false
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: ds-pipelines-api-server
dockerfile: backend/Dockerfile
- image: ds-pipelines-frontend
dockerfile: frontend/Dockerfile
- image: ds-pipelines-cacheserver
dockerfile: backend/Dockerfile.cacheserver
- image: ds-pipelines-persistenceagent
dockerfile: backend/Dockerfile.persistenceagentz
- image: ds-pipelines-scheduledworkflow
dockerfile: backend/Dockerfile.scheduledworkflow
- image: ds-pipelines-viewercontroller
dockerfile: backend/Dockerfile.viewercontroller
- image: ds-pipelines-artifact-manager
dockerfile: backend/artifact_manager/Dockerfile
- image: ds-pipelines-metadata-writer
dockerfile: backend/metadata_writer/Dockerfile
- image: ds-pipelines-metadata-envoy
dockerfile: third-party/ml-metadata/Dockerfile
- image: ds-pipelines-metadata-grpc
dockerfile: third-party/metadata_envoy/Dockerfile
steps:
- uses: actions/checkout@v3
- name: Generate Tag
shell: bash
id: tags
env:
SOURCE_BRANCH: ${{ env.SOURCE_BRANCH }}
run: |
commit_sha=${{ github.event.after }}
tag=${SOURCE_BRANCH}-${commit_sha:0:7}
echo "tag=${tag}" >> $GITHUB_OUTPUT
- name: Build Image
uses: ./.github/actions/build
env:
IMG: quay.io/${{ env.QUAY_ORG }}/${{ matrix.image }}:${{ steps.tags.outputs.tag }}
TARGET_IMAGE_TAG: ${{ steps.tags.outputs.tag }}
with:
OVERWRITE: true
IMAGE_REPO: ${{ matrix.image }}
DOCKERFILE: ${{ matrix.dockerfile }}
GH_REPO: ${{ github.repository }}
- name: Tag latest
shell: bash
env:
IMG: quay.io/${{ env.QUAY_ORG }}/${{ matrix.image }}
NEWEST_TAG: ${{ steps.tags.outputs.tag }}
SOURCE_BRANCH: ${{ env.SOURCE_BRANCH }}
run: |
podman tag ${IMG}:${NEWEST_TAG} ${IMG}:latest
podman push ${IMG}:latest
podman tag ${IMG}:${NEWEST_TAG} ${IMG}:${SOURCE_BRANCH}
podman push ${IMG}:${SOURCE_BRANCH}

0 comments on commit ae62f34

Please sign in to comment.