-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (44 loc) · 1.61 KB
/
website-update-api-reference.yml
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
# website-update-api-reference.yml
name: Website update API reference
on:
release:
types: [published]
workflow_dispatch:
jobs:
update-api-reference-and-website-demo-files:
runs-on: ubuntu-latest
steps:
- uses: DeterminateSystems/nix-installer-action@v12
- uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: actions/checkout@v4
- name: Build the API reference
run: |
cd website
npm install spectaql
npx spectaql spectaql-config.yml -t static -f api-reference.html
- name: Generate the website demo files
run: nix develop -c make e2e
- name: Commit the API reference and website demo changes
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
git add website/static
git commit -m "docs: api reference and website examples update to $GITHUB_SHA"
git reset --hard
git pull --rebase origin main
git push origin HEAD:main
- name: Install Website Dependencies
run: |
cd website
nix-shell -p yarn --run "yarn install --frozen-lockfile"
- name: Build Website
run: |
cd website
nix-shell -p yarn --run "yarn build"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com