Repository navigation
94 lines (79 loc) · 2.67 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
94 lines (79 loc) · 2.67 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
85
86
87
88
89
90
91
92
93
94
name: Deploy Documentation
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
permissions: {}
concurrency:
group: "docs-${{ github.ref }}"
cancel-in-progress: true
jobs:
# Dependabot bumps package.json but cannot regenerate bun.lock, so a merged
# dependency PR leaves the two out of sync and every later `bun install
# --frozen-lockfile` fails. Catch that drift on the PR that introduces it.
lockfile:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.3.14
- name: Resolve dependencies without the lockfile pin
run: bun install --no-frozen-lockfile
- name: Check bun.lock matches package.json
run: |
if ! git diff --quiet -- bun.lock; then
echo "::error file=bun.lock::bun.lock is out of sync with package.json. Run 'bun install' locally and commit the updated bun.lock."
git --no-pager diff --stat -- bun.lock
exit 1
fi
echo "bun.lock is in sync with package.json."
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.3.14
- name: Setup Pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Type-check content and components
run: bun run check
- name: Build documentation
run: bun run build
- name: Upload Pages artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: ./dist
deploy:
if: github.event_name != 'pull_request'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0