-
Notifications
You must be signed in to change notification settings - Fork 14
76 lines (65 loc) · 1.92 KB
/
docs-website.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
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
name: documentation
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
docs:
name: documentation-website
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/[email protected]
with:
go-version: '1.22'
id: go
- run: go version
- uses: actions/setup-node@v4
with:
node-version: 'lts/Hydrogen'
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: install algolia-client
run: |
go get -u github.com/algolia/algoliasearch-client-go/v3@v3
go mod vendor
- name: generate block attributes from go source
env:
SEARCH_CLIENT_API_KEY: ${{ secrets.SEARCH_CLIENT_API_KEY }}
run: make generate-docs
- name: build website
working-directory: docs/website
run: |
npm ci && npm run build && npm run generate
- name: create artifact
uses: actions/upload-artifact@v2
with:
name: dist
path: |
docs/website/.output/public
if-no-files-found: warn
retention-days: 2
deploy:
name: 'deploy via github pages'
runs-on: ubuntu-latest
needs:
- docs
steps:
- uses: actions/download-artifact@v2
with:
name: dist
path: 'dist'
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_COUPER_API_TOKEN }}
path: 'website'
repository: 'coupergateway/couper-docs'
- run: rm -rf website/*/ website/access-control website/command-line # clear sub-folders
- run: cp -RTv dist/ website
- name: setup git && push
working-directory: './website'
run: |
git config user.name "couper-bot"
git config user.email "[email protected]"
git add -A && git commit -m "Update website"
git push origin main