-
Notifications
You must be signed in to change notification settings - Fork 15
62 lines (57 loc) · 1.75 KB
/
Copy pathdeploy-gallery.yml
File metadata and controls
62 lines (57 loc) · 1.75 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
# Deploys the gallery site (site/) to GitHub Pages.
#
# One-time setup: enable GitHub Pages in the repo settings with
# "GitHub Actions" as the source. After that, every merge to main that
# touches the examples, the site, or hub.config.json rebuilds and
# redeploys the gallery, so new examples show up on their own. The
# manual trigger stays around for one-off redeploys.
name: Deploy gallery
on:
push:
branches: [main]
paths:
- "catalog/**"
- "examples/**"
- "site/**"
- "hub.config.json"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 20
cache: npm
cache-dependency-path: site/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: site
- name: Build site
run: npm run build
working-directory: site
- uses: actions/configure-pages@v6
- uses: actions/upload-pages-artifact@v5
with:
path: site/dist
# Per-attempt name so re-running a failed run doesn't collide
# with the previous attempt's artifact.
name: github-pages-${{ github.run_attempt }}
- id: deployment
uses: actions/deploy-pages@v5
with:
artifact_name: github-pages-${{ github.run_attempt }}
# Pages can be slow to process deployments; give it 20 minutes
# instead of the default 10 before declaring a timeout.
timeout: 1200000