Skip to content

Commit

Permalink
Merge branch 'feature/CSC-1652-gh-action-for-processing-custom-sheets…
Browse files Browse the repository at this point in the history
…' into staging
  • Loading branch information
danielxvu committed Oct 2, 2023
2 parents a5faeb4 + 88596af commit b746338
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/use-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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'

0 comments on commit b746338

Please sign in to comment.