Skip to content

Commit

Permalink
fix: use variable expansion instead of template expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
fboulnois committed Jan 8, 2025
1 parent 950492d commit 02ee9e8
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,22 @@ jobs:
- name: Construct tags
id: construct-tags
run: |
SHA_TAG="${REGISTRY_HOST}/${GOOGLE_PROJECT}/${SERVICE_NAME}:${{ steps.short-sha.outputs.sha }}"
SHA_TAG="${REGISTRY_HOST}/${GOOGLE_PROJECT}/${SERVICE_NAME}:${SHORT_SHA}"
ENVIRONMENT_TAG=""
if ${{ github.event_name == 'pull_request'}}; then
ENVIRONMENT_TAG="${REGISTRY_HOST}/${GOOGLE_PROJECT}/${SERVICE_NAME}:pr-${{ steps.short-sha.outputs.sha }}"
ENVIRONMENT_TAG="${REGISTRY_HOST}/${GOOGLE_PROJECT}/${SERVICE_NAME}:pr-${SHORT_SHA}"
elif ${{github.event_name == 'push' }}; then
ENVIRONMENT_TAG="${REGISTRY_HOST}/${GOOGLE_PROJECT}/${SERVICE_NAME}:dev"
fi
echo "sha-tag=$SHA_TAG" >> $GITHUB_OUTPUT
echo "environment-tag=$ENVIRONMENT_TAG" >> $GITHUB_OUTPUT
env:
SHORT_SHA: ${{ steps.short-sha.outputs.sha }}
- name: Build Image
run: |
docker build \
-t ${{ steps.construct-tags.outputs.sha-tag }} \
-t ${{ steps.construct-tags.outputs.environment-tag }} \
.
run: docker build -t "${SHA_TAG}" -t "${ENVIRONMENT_TAG}" .
env:
SHA_TAG: ${{ steps.construct-tags.outputs.sha-tag }}
ENVIRONMENT_TAG: ${{ steps.construct-tags.outputs.environment-tag }}
- id: 'auth'
if: github.actor != 'dependabot[bot]'
name: 'Authenticate to Google Cloud'
Expand All @@ -59,8 +60,11 @@ jobs:
if: github.actor != 'dependabot[bot]'
run: |
gcloud auth configure-docker --quiet
docker push ${{ steps.construct-tags.outputs.sha-tag }}
docker push ${{ steps.construct-tags.outputs.environment-tag }}
docker push "${SHA_TAG}"
docker push "${ENVIRONMENT_TAG}"
env:
SHA_TAG: ${{ steps.construct-tags.outputs.sha-tag }}
ENVIRONMENT_TAG: ${{ steps.construct-tags.outputs.environment-tag }}
report-to-sherlock:
uses: broadinstitute/sherlock/.github/workflows/client-report-app-version.yaml@main
needs: [tag-build-push]
Expand Down

0 comments on commit 02ee9e8

Please sign in to comment.