From 88596af9eb1cb34e8ad6e0fc045e80f9837508c1 Mon Sep 17 00:00:00 2001 From: Daniel Vu Date: Mon, 2 Oct 2023 00:57:06 -0400 Subject: [PATCH] Makes DEST_DIR reusable --- .github/workflows/use-sdk.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/use-sdk.yml b/.github/workflows/use-sdk.yml index a87244054a5..f36cb1a7526 100644 --- a/.github/workflows/use-sdk.yml +++ b/.github/workflows/use-sdk.yml @@ -6,12 +6,13 @@ env: NPM_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} jobs: - staging-deployment: - if: github.ref == 'refs/heads/staging' - environment: staging + deployment: + if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/master' + environment: ${{ github.ref_name == 'master' && 'production' || 'staging' }} runs-on: ubuntu-latest env: CDN_SHEETS_FOLDER: ${{ vars.CDN_SHEETS_FOLDER }} + DEST_DIR: ${{ runner.temp }}/${{ env.CDN_SHEETS_FOLDER }} # Set job outputs to values from filter step outputs: sheet: ${{ steps.filter.outputs.sheet }} @@ -53,13 +54,13 @@ jobs: working-directory: contrib/sheet-pixie # Handles when sheets have been updated individually - - run: DEST_DIR=${{ runner.temp }}/${{ env.CDN_SHEETS_FOLDER }} bun run contrib/sheet-pixie/index.ts ${{ steps.filter.outputs.sheet_files }} + - run: bun run contrib/sheet-pixie/index.ts ${{ steps.filter.outputs.sheet_files }} if: steps.filter.outputs.sheet == 'true' - run: gcloud storage rsync --project=roll20-actual ${{ runner.temp }}/${{ env.CDN_SHEETS_FOLDER }} gs://roll20-cdn/${{ env.CDN_SHEETS_FOLDER }} --cache-control='no-cache' --recursive if: steps.filter.outputs.sheet == 'true' # Handles when a force-update has been requested (meaning all sheets will be re-built and deployed) - run: make all - if: steps.filter.outputs.force-update == 'true' + if: steps.filter.outputs.sheet != 'true' && steps.filter.outputs.force-update == 'true' - run: gcloud storage rsync --project=roll20-actual ${{ runner.temp }}/${{ env.CDN_SHEETS_FOLDER }} gs://roll20-cdn/${{ env.CDN_SHEETS_FOLDER }} --delete-unmatched-destination-objects --cache-control='no-cache' --recursive - if: steps.filter.outputs.force-update == 'true' + if: steps.filter.outputs.sheet != 'true' && steps.filter.outputs.force-update == 'true'