Repository navigation
93 lines (88 loc) · 2.86 KB
/
Copy pathdocs.yml
File metadata and controls
93 lines (88 loc) · 2.86 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
name: docs
# Builds the docs site (site/) and deploys it to GitHub Pages at
# https://noctcore.github.io/showcase-kit/.
#
# Pull requests build and check the site without deploying, so a broken link,
# a missing page or a page still marked as a stub fails before merge.
#
# Before the first deploy, Pages must be enabled for the repository with
# "GitHub Actions" as its source (Settings, Pages, Build and deployment).
#
# Every action is pinned to a full commit SHA with its version beside it.
on:
push:
branches: [main]
paths:
- 'site/**'
- 'src/**'
- 'CHANGELOG.md'
- '.changeset/**'
- 'package.json'
- 'tsup.config.ts'
- 'bun.lock'
- '.github/workflows/docs.yml'
pull_request:
paths:
- 'site/**'
- 'src/**'
- 'CHANGELOG.md'
- '.changeset/**'
- 'package.json'
- 'tsup.config.ts'
- 'bun.lock'
- '.github/workflows/docs.yml'
workflow_dispatch: {}
permissions:
contents: read
# One deploy at a time; never cancel one halfway through.
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: build site
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# The changelog page reads each release's date from its tag.
fetch-depth: 0
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.2
# Astro 7 needs Node 22.12 or newer; the runner image ships an older one.
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
- run: bun install --frozen-lockfile
# The site reads the library's built dist/ for its reference pages.
- run: bun run build
# site/ is a standalone package with its own lockfile, not a workspace.
- run: bun install --frozen-lockfile
working-directory: site
- run: bun run test
working-directory: site
- run: bun run typecheck
working-directory: site
# sync -> astro build -> scripts/check-build.ts (routes, base, links,
# fragments, stub pages).
- run: bun run docs:build
- if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site/dist
deploy:
name: deploy to Pages
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-24.04
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1