Deploy to GitHub Pages #92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to GitHub Pages | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
schedule: | |
- cron: '52 18 * * 2' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "deploy" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout self | |
uses: actions/checkout@v4 | |
- name: Checkout scratch-gui | |
uses: actions/checkout@v4 | |
with: | |
repository: TurboWarp/scratch-gui | |
path: scratch-gui | |
- name: Setup GitHub Pages | |
id: pages | |
uses: actions/configure-pages@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Build | |
run: | | |
cd scratch-gui | |
npm ci | |
NODE_ENV=production ROUTING_STYLE=hash npm run build | |
- name: Patch | |
run: python3 patch.py | |
- name: Upload pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./scratch-gui/build/ | |
retention-days: 30 | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |