Skip to content

Migrate tutorials

Migrate tutorials #7

Workflow file for this run

name: Deploy MyST Documentation
on:
push:
branches: [main, migrate-tutorials]
paths:
- "tutorials/**"
- ".github/workflows/deploy-docs.yml"
pull_request:
branches: [main]
paths:
- "tutorials/**"
- ".github/workflows/deploy-docs.yml"
workflow_dispatch: # Allow manual trigger
env:
# For custom domain docs.commontools.dev, we don't need a subfolder
BASE_URL: ""
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: tutorials/package-lock.json
- name: Install dependencies
working-directory: tutorials
run: npm ci
- name: Build MyST site
working-directory: tutorials
run: npm run build
- name: Copy CNAME to build directory
run: cp tutorials/CNAME tutorials/_build/html/CNAME
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "tutorials/_build/html"
deploy:
# Only deploy from main and migrate-tutorials branches, not from PRs
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/migrate-tutorials')
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