1name: Deploy documentation to GitHub pages
2on:
3  push:
4    branches: [ master ]
5jobs:
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 "action@github.com"
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/github-push-action@v0.5.0
30      with:
31        github_token: ${{ secrets.GITHUB_TOKEN }}
32        branch: gh-pages
33        force: true
34        directory: ./docs/.vuepress/dist
35