Skip to content

Commit 0e1523e

Browse files
derick-montaguerfrandse
authored andcommitted
Add action to deploy documentation
This was merged using Gerrit, but due to being part of the .github directory the merge is not showing. After this commit, I will rebase with Gerrit. - Action will run npm install and docs:build and push the static files to the gh-pages branch - Will build documentation and push to the gh-pages branch on every push to master - Tested on a forked repo: https://derick-montague.github.io/webui-vue/ - Workflow that was used is the same as being pushed with this commit: https://github.com/derick-montague/webui-vue/actions/runs/316032970/workflow
1 parent c2e6c68 commit 0e1523e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy documentation to GitHub pages
2+
on:
3+
push:
4+
branches: [ master ]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Generate static vuepress files
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: '12.x'
16+
- run: npm ci
17+
- run: npm run docs:build
18+
19+
- name: Init new repo in dist folder and commit generated files
20+
run: |
21+
cd docs/.vuepress/dist
22+
git init
23+
git add -A
24+
git config --local user.email "[email protected]"
25+
git config --local user.name "GitHub Action"
26+
git commit -m 'deploy'
27+
28+
- name: Force push to gh-pages branch
29+
uses: ad-m/[email protected]
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
branch: gh-pages
33+
force: true
34+
directory: ./docs/.vuepress/dist

0 commit comments

Comments
 (0)