-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.24 KB
/
release-web-page.yml
File metadata and controls
50 lines (43 loc) · 1.24 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
name: release web page
on:
push:
branches:
- master
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Specifications
uses: actions/checkout@v6
with:
path: 'master-branch'
- name: Install redoc-cli
uses: actions/setup-node@v6
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Build html page
working-directory: master-branch
run: |
npm install -g @redocly/cli;
npx @redocly/cli build-docs index.yml -o=doc.html;
- name: Checkout pages branch
uses: actions/checkout@v6
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 "action@github.com"
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 }}