Repository navigation
96 lines (87 loc) · 2.29 KB
/
Copy pathdocs.yml
File metadata and controls
96 lines (87 loc) · 2.29 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
95
96
name: Docs
on:
push:
branches: [master]
paths:
- 'package.json'
- '*/README.md'
- '*/CHANGELOG.md'
- '*/docs/**'
- '*/prompts/**'
- '*/package.json'
- '*/*/README.md'
- '*/*/CHANGELOG.md'
- '*/*/docs/**'
- '*/*/prompts/**'
- '*/*/package.json'
- '.github/workflows/docs.yml'
repository_dispatch:
types: [website-updated]
workflow_dispatch:
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
ref: master
path: source
- uses: actions/checkout@v7
with:
ref: website
path: site
- uses: actions/checkout@v7
with:
repository: thenolle/gambrel
path: site/.gambrel
token: ${{ secrets.GAMBREL_TOKEN || github.token }}
persist-credentials: false
- uses: oven-sh/setup-bun@v2
- name: Install
working-directory: site
run: bun install
- name: Type-check
working-directory: site
run: bun run typecheck
- name: Build
working-directory: site
env:
SOURCE_DIR: ../source
SITE_URL: https://thenolle.github.io/userscripts/
run: bun run build
- uses: actions/upload-pages-artifact@v4
with:
path: site/dist
- name: Refresh the generated README
continue-on-error: true
working-directory: site
env:
SOURCE_DIR: ../source
SITE_URL: https://thenolle.github.io/userscripts/
run: |
bun run readme
cd ../source
if ! git diff --quiet -- README.md; then
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add README.md
git commit -m 'docs: refresh README [skip ci]'
git push origin master
fi
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4