diff --git a/.github/workflows/build_C-PAC.yml b/.github/workflows/build_C-PAC.yml index 9db89d2777..ed2d1039bb 100644 --- a/.github/workflows/build_C-PAC.yml +++ b/.github/workflows/build_C-PAC.yml @@ -32,6 +32,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set tag & Dockerfile + if: github.ref_type == 'branch' run: | if [[ "${{ inputs.variant }}" != "" ]] then @@ -66,6 +67,24 @@ jobs: echo DOCKER_TAG=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):$TAG >> $GITHUB_ENV echo DOCKERFILE="${DOCKERFILE}" >> $GITHUB_ENV cat $GITHUB_ENV + - name: Set tag & Dockerfile + if: github.ref_type == 'tag' + run: | + if [[ "${{ inputs.variant }}" != "" ]] + then + VARIANT=-${{ inputs.variant }} + fi + TAG=latest + if [[ $VARIANT == "" ]] + then + DOCKERFILE=Dockerfile + else + DOCKERFILE=variant$VARIANT.Dockerfile + fi + TAG=$TAG$VARIANT + echo DOCKER_TAG=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):$TAG >> $GITHUB_ENV + echo DOCKERFILE="${DOCKERFILE}" >> $GITHUB_ENV + cat $GITHUB_ENV - name: Prep Dockerfiles for forked repository if: ${{ github.repository_owner }} != 'FCP-INDI' run: .github/scripts/local_ghcr $DOCKERFILE ${{ github.repository_owner }} $DOCKER_TAG