52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
name: Deploy Editor
|
|
|
|
on:
|
|
workflow_dispatch: {}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
uses: dicebear/dicebear/.github/workflows/test.yml@10.x
|
|
deploy:
|
|
needs: test
|
|
environment: editor
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
# Remove all languages except English due GDPR reasons, because we can't translate the legal pages.
|
|
- name: Cleanup languages
|
|
run: find apps/editor/src/messages -type f ! -name 'en.json' -exec rm -f {} +
|
|
|
|
- name: Build editor
|
|
env:
|
|
VITE_PRIVACY_POLICY_URL: ${{ vars.VITE_PRIVACY_POLICY_URL }}
|
|
VITE_COOKIE_POLICY_URL: ${{ vars.VITE_COOKIE_POLICY_URL }}
|
|
VITE_LEGAL_NOTICE_URL: ${{ vars.VITE_LEGAL_NOTICE_URL }}
|
|
run: npx turbo run build --filter='@dicebear/editor...'
|
|
|
|
- name: Deploy to Bunny.net
|
|
uses: ayeressian/bunnycdn-storage-deploy@251c77f4b9e7e683ad00086de2bef5770c3386b2 # v2.4.5
|
|
with:
|
|
source: 'apps/editor/dist'
|
|
destination: ''
|
|
storageZoneName: '${{ secrets.EDITOR_STORAGE_NAME }}'
|
|
storagePassword: '${{ secrets.EDITOR_STORAGE_PASSWORD }}'
|
|
accessKey: '${{ secrets.CDN_ACCESS_KEY }}'
|
|
pullZoneId: '${{ secrets.EDITOR_PULL_ZONE_ID }}'
|
|
upload: 'true'
|
|
remove: 'true'
|
|
purgePullZone: 'true'
|