3.1.1 #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow builds the repository documentation using VuePress and deploy it on GitHub Pages. | |
# Strongly inspired by https://kaizendorks.github.io/2020/04/16/vuepress-github-actions/ | |
name: Deploy documentation | |
on: | |
release: | |
types: [ released ] | |
# See existing types at https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release | |
# Allows to run the workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
# This workflow contains a single job called “build”. | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
# The sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
# Install Node dependencies and build the documentation website | |
- name: Generate static VuePress files | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm ci | |
- run: npm run docs:build | |
# Commit the documentation changes and send it to the Github Pages branch | |
- name: Commit the documentation changes | |
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 'Update generated documentation' | |
- name: Force push to destination branch | |
# https://github.com/marketplace/actions/github-push | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
force: true | |
# Directory from which the action is executed | |
directory: ./docs/.vuepress/dist |