Files
packager/.github/workflows/deploy.yml
T
Lu Yifei d5ebe6cb47 feat(protection): add program-specialized packager
Build offline specialized players from the matching Scratch VM, with audited linking, pruning and scheduling-property renaming across browser, Node and standalone outputs.
2026-09-25 19:47:33 +08:00

74 lines
1.8 KiB
YAML

name: Deploy to GitHub Pages
on:
workflow_dispatch:
push:
branches: [main]
concurrency:
group: "deploy"
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
working-directory: tw-packager
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
path: tw-packager
- uses: ./tw-packager/.github/actions/setup-specialized
with:
vm-ref: ${{ vars.SPECIALIZED_VM_REF }}
- name: Test
run: |
npm test -- --runInBand
npm run build-node-prod
npm run test:specialized
node test/specialized-differential.mjs --linked
npm run test:specialized-build
node test/specialized-worker-input.mjs
npx playwright install --with-deps chromium firefox webkit
npm run test:specialized-browser
npm run test:specialized-performance
- name: Build website
run: |
mkdir -p web
npm run build-prod
cp -r dist/* web
env:
ENABLE_SERVICE_WORKER: "1"
- name: Build standalone
run: |
npm run build-standalone-prod
node test/specialized-standalone.mjs
cp dist/standalone.html web
- name: Configure GitHub Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./tw-packager/web/
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
timeout-minutes: 10
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4