forked from serverpod/serverpod_docs
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (60 loc) · 1.95 KB
/
Copy pathdeploy.yml
File metadata and controls
63 lines (60 loc) · 1.95 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
name: Docusaurus deploy
on:
push:
branches:
- main
permissions:
contents: write
jobs:
deploy:
if: github.repository == 'serverpod/serverpod_docs'
runs-on: ubuntu-latest
environment: deploy
steps:
- uses: actions/checkout@v4
with:
path: src
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: src/package-lock.json
- name: Build docs
run: |
cd src
npm ci
npm run test:open-graph
npm run build
- name: Verify markdown export
run: |
cd src
node util/verify_markdown_export.js
- name: Verify Open Graph images
run: |
cd src
node util/verify_open_graph_images.js
- uses: actions/checkout@v4
with:
path: target
ref: main
repository: serverpod/serverpod.github.io
ssh-key: ${{ secrets.GH_PAGES_DEPLOY }}
- name: Deploy to target
run: |
git config --global user.email "serverpod_docs@serverpod.dev"
git config --global user.name "serverpod_docs"
# Dotfiles must deploy too (.nojekyll keeps GitHub Pages from
# running Jekyll over the generated .md files), so copy the
# directory contents rather than a dotfile-skipping glob.
rm -rf target/docs
mkdir -p target/docs
cp target/CNAME target/docs
cp -a src/build/. target/docs
cd target
git add .
if git diff --cached --quiet; then
echo "No changes to deploy — skipping commit and push."
exit 0
fi
git commit -m "Deployed by Serverpod docs deploy action"
git push