mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
Pushes to main deployed the website immediately, so docs for unreleased features went live before the release that ships them. Publish Release now deploys the released tag after publication, the same way it calls Docker Publish, and only the Cloudflare secrets are passed to the deploy. Website Pages can still be dispatched with a tag or branch to redeploy or ship a docs-only fix. Validation: actionlint on all workflows and ai-context check.
86 lines
2.1 KiB
YAML
86 lines
2.1 KiB
YAML
name: Website Pages
|
|
|
|
# Publish Release calls this after publication so the live docs match the released
|
|
# version; dispatch it by hand to redeploy a tag or ship a docs-only fix.
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
ref:
|
|
type: string
|
|
required: true
|
|
secrets:
|
|
CLOUDFLARE_API_TOKEN:
|
|
required: true
|
|
CLOUDFLARE_ACCOUNT_ID:
|
|
required: true
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: Tag or branch to deploy (e.g. v0.24.0)
|
|
type: string
|
|
required: true
|
|
|
|
permissions:
|
|
contents: read
|
|
deployments: write
|
|
|
|
# Only the newest push matters: an older run still building would deploy stale docs over it.
|
|
concurrency:
|
|
group: website-pages
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CLOUDFLARE_PROJECT_NAME: skillshare
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ inputs.ref }}
|
|
|
|
- name: Check AI context routes
|
|
run: python3 scripts/ai-context.py check
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
cache: npm
|
|
cache-dependency-path: website/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: website
|
|
run: npm ci
|
|
|
|
- name: Build website
|
|
working-directory: website
|
|
run: npm run build
|
|
|
|
- name: Upload Pages artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: website-build
|
|
path: website/build
|
|
retention-days: 1
|
|
|
|
deploy:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Download Pages artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: website-build
|
|
path: website/build
|
|
|
|
- name: Deploy to Cloudflare Pages
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: pages deploy website/build --project-name=${{ env.CLOUDFLARE_PROJECT_NAME }} --branch=main
|
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|