-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.52 KB
/
release-web-page.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
name: release web page
on:
push:
branches:
- master
jobs:
build-and-push:
runs-on: ubuntu-20.04
steps:
- name: Checkout Specifications
uses: actions/checkout@v2
with:
path: 'master-branch'
- name: Install redoc-cli
uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Build html page
working-directory: master-branch
run: |
npm install -g redoc-cli;
npx redoc-cli build "./index.yml" --output doc.html \
--options.maxDisplayedEnumValues=5 --options.theme.logo.gutter="20px" \
--options.theme.colors.primary.main="#8a53cb" --options.expandResponses="all" \
--options.expandSingleSchemaField --options.hideDownloadButton \
--options.jsonSampleExpandLevel="6";
- name: Checkout pages branch
uses: actions/checkout@v3
with:
path: 'pages-branch'
ref: 'gh-pages'
- name: Rewrite html page
working-directory: pages-branch
run: |
rm index.html
mv ../master-branch/doc.html index.html
- name: Push changes
working-directory: pages-branch
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add --all
git commit -m "update pages"
git push origin gh-pages
env:
GITHUB_TOKEN: ${{ secrets.REGULA_GITHUB_PUSH_TOKEN }}