Skip to content

Commit

Permalink
Add action to deploy documentation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
derick-montague authored and rfrandse committed Jun 30, 2022
1 parent c2e6c68 commit 0e1523e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/deploy-docs-to-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy documentation to GitHub pages
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Generate static vuepress files
uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm ci
- run: npm run docs:build

- name: Init new repo in dist folder and commit generated files
run: |
cd docs/.vuepress/dist
git init
git add -A
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'deploy'
- name: Force push to gh-pages branch
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true
directory: ./docs/.vuepress/dist

0 comments on commit 0e1523e

Please sign in to comment.