-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (75 loc) · 2.36 KB
/
docs.yml
File metadata and controls
84 lines (75 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Deploy Docs
on:
# Keep release/manual/reusable invocations build-only: do not publish the
# normal docs site. PR #21's progress-page updates are the only automatic
# GitHub Pages publication path from this workflow.
workflow_call:
inputs:
is_prerelease:
description: 'Skip deploy when true (build-only). Defaults to false (deploy).'
required: false
type: boolean
default: false
release:
types: [published]
push:
branches: [main]
paths:
- 'docs/src/content/docs/progress/**'
- 'docs/astro.config.mjs'
pull_request:
paths: ['docs/**']
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages-${{ github.ref }}"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: 'docs/package-lock.json'
- name: Install dependencies
working-directory: ./docs
run: npm ci
- name: Build documentation
working-directory: ./docs
run: npm run build
- name: Upload build artifacts
# NOTE: in a reusable workflow, github.event_name reflects the CALLER's
# event (here: 'push' of a v* tag from build-release.yml), NOT
# 'workflow_call'. Detect the workflow_call invocation via the tag-push
# context instead. PR runs (event_name == 'pull_request') correctly
# build-only because none of the three branches match.
if: |
github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: docs/dist
deploy:
needs: build
# Only PR #21 progress-page updates on main publish to GitHub Pages.
# Release/manual/reusable invocations build but do not deploy normal docs.
if: |
github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4