Merge pull request #13500 from Roll20/feature/FAST-1766-transform-google-font-urls-for-discord-activity

FAST-1766: Proper Resolution for Font / Asset loading in Beacon Character Sheets
This commit is contained in:
Daniel Vu
2024-11-25 11:57:31 -05:00
committed by GitHub
2 changed files with 205 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
name: Process and Upload Fonts
on:
push:
branches:
- staging
- master
paths:
- '**.css'
jobs:
process-fonts:
environment: ${{ github.ref_name == 'master' && 'production' || 'staging' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install required tools
run: sudo apt-get update && sudo apt-get install -y zsh perl curl
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.SHEET_HTTP_GCP_KEYFILE }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Process Font URLs
run: |
chmod +x ./process-fonts.sh
CLIENT_ID=${{ github.ref_name == 'master' && '1199271093882589195' || '1199270539278164008' }}
DISCORD_ACTIVITY_CLIENT_ID=$CLIENT_ID \
./process-fonts.sh --no-prompt --output-dir ${{ runner.temp }}/sheet-fonts
- name: Upload to GCS
run: |
ENV_PATH="${{ github.ref_name == 'master' && 'production' || 'staging' }}"
# Sync the entire fonts directory
gcloud storage rsync \
--project=roll20-actual \
${{ runner.temp }}/sheet-fonts \
"gs://roll20-cdn/discord/fonts/$ENV_PATH" \
--recursive \
--cache-control="no-cache"