summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Montague <derick.montague@ibm.com>2020-10-19 22:29:59 +0300
committerDerick Montague <derick.montague@ibm.com>2020-10-23 07:23:01 +0300
commite95219c01f450b2de08b915bac40e12219b70d51 (patch)
treede4490b92117a2765ec5490c2e7aba6ddf017998
parent579cbdf4646fbdf8db2419ee046d812189894afc (diff)
downloadwebui-vue-e95219c01f450b2de08b915bac40e12219b70d51.tar.xz
Add action to deploy documentation
- 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 Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: Ia5e7a95712aff3c9bac2d18fa7d4473851ebaa60
-rw-r--r--.github/workflows/deploy-docs-to-gh-pages.yml34
1 files changed, 34 insertions, 0 deletions
diff --git a/.github/workflows/deploy-docs-to-gh-pages.yml b/.github/workflows/deploy-docs-to-gh-pages.yml
new file mode 100644
index 00000000..bbc39dde
--- /dev/null
+++ b/.github/workflows/deploy-docs-to-gh-pages.yml
@@ -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 "action@github.com"
+ git config --local user.name "GitHub Action"
+ git commit -m 'deploy'
+
+ - name: Force push to gh-pages branch
+ uses: ad-m/github-push-action@v0.5.0
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ branch: gh-pages
+ force: true
+ directory: ./docs/.vuepress/dist