From e90f606f43b28a82966b9c178aaefe95e0d95369 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Thu, 24 Oct 2024 11:21:32 -0400 Subject: [PATCH] feat: pass env into builder --- .github/workflows/main.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 12af11982..e53d50af8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,12 +65,22 @@ jobs: - name: Test inside of the docker container run: | docker run --rm builder npm run coverage + - name: Get Git Short Sha and API version + id: vars + run: | + echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "API_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_OUTPUT + echo "IS_TAGGED=$(git describe --tags --abbrev=0 --exact-match || echo '') >> $GITHUB_OUTPUT + echo "::set-output name=API_VERSION::${API_VERSION}" - name: Build inside of the docker container id: build-pack-binary run: | - docker run --rm -v ${{ github.workspace }}/api/deploy/release:/app/deploy/release -v ${{ github.workspace}}/.git:/app/.git builder npm run build-and-pack - API_VERSION=$(cat package.json | jq -r '.version') - echo "::set-output name=API_VERSION::${API_VERSION}" + docker run --rm -v ${{ github.workspace }}/api/deploy/release:/app/deploy/release builder npm run build-and-pack + with: + env: + GIT_SHA=${{ steps.vars.outputs.sha_short }} + API_VERSION=${{ steps.vars.outputs.API_VERSION }} + IS_TAGGED=${{ steps.vars.outputs.IS_TAGGED }} - name: Set Hashes id: set-hashes