Merge branch 'main' of https://github.com/unyt-org/datex-specification #131
This file contains hidden or 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 Specification | |
on: | |
push: | |
branches: | |
- main | |
workflow_run: | |
workflows: | |
- "Create Chapter" | |
- "Move Chapter" | |
- "Rename Chapter" | |
types: | |
- completed | |
workflow_dispatch: {} | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: latest | |
- name: Auto fix chapter numerierung | |
run: | | |
deno run -A ./scripts/update.ts | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add -A | |
git diff --cached --quiet || (git commit -m "fix: renumber chapters after push" && git push) | |
- name: Clone spec‑generator repo | |
run: | | |
git clone --depth 1 https://github.com/unyt-org/spec-generator.git | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: npm | |
cache-dependency-path: spec-generator/package-lock.json | |
- name: Install dependencies | |
run: | | |
cd spec-generator | |
npm ci --legacy-peer-deps | |
echo "Dependencies installed successfully" | |
- name: Run spec update script | |
run: | | |
cd spec-generator | |
node update-specs.mjs | |
echo "Spec update completed" | |
- name: Build documentation | |
run: | | |
cd spec-generator | |
npm run docs:build | |
echo "Documentation build completed" | |
- name: Verify build output | |
run: | | |
cd spec-generator | |
ls -la docs/.vitepress/dist/ | |
echo "Build verification successful" | |
- name: Add CNAME for custom domain | |
run: echo "datex.unyt.org" > spec-generator/docs/.vitepress/dist/CNAME | |
- name: Upload build artifacts | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: spec-generator/docs/.vitepress/dist/ | |
retention-days: 3 | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deploy.outputs.page_url }} | |
steps: | |
- id: deploy | |
uses: actions/deploy-pages@v4 |