From b4e1404d73c7d09e219a64613ebffbc514e039ca Mon Sep 17 00:00:00 2001 From: bmotevalli Date: Tue, 2 Apr 2024 14:56:13 +0800 Subject: [PATCH] adding a separate build for dev-sample. --- .github/workflows/build.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f88f958..2edc9a85 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - dev-sample jobs: @@ -53,10 +54,19 @@ jobs: id: timestamp run: echo "::set-output name=timestamp::$(date +'%Y%m%d%H%M%S')" + - name: Set dynamic tag + id: set-tag + run: | + if [[ "${{ github.ref }}" == "refs/heads/dev-sample" ]]; then + echo "::set-output name=tag::ghcr.io/auscope/auscope-ckan-dev:sample-${{ steps.timestamp.outputs.timestamp }}" + else + echo "::set-output name=tag::ghcr.io/auscope/auscope-ckan-dev:latest-${{ steps.timestamp.outputs.timestamp }}" + fi + - name: Build and Push Docker image to GHCR (Dev) uses: docker/build-push-action@v2 with: context: ./ckan file: ./ckan/Dockerfile # Consider using a separate Dockerfile for dev if needed - tags: ghcr.io/auscope/auscope-ckan-dev:latest-${{ steps.timestamp.outputs.timestamp }} + tags: ${{ steps.set-tag.outputs.tag }} # ghcr.io/auscope/auscope-ckan-dev:latest-${{ steps.timestamp.outputs.timestamp }} push: true