diff --git a/.github/workflows/use-sdk.yml b/.github/workflows/use-sdk.yml index a87244054a51..f36cb1a7526c 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'