xref: /openbmc/webui-vue/.github/workflows/deploy-docs-to-gh-pages.yml (revision 7385e139b0c9efca7430458cee982e63e282f4ae)
11bddf797SDerick Montaguename: Deploy documentation to GitHub pages
21bddf797SDerick Montagueon:
31bddf797SDerick Montague    push:
41bddf797SDerick Montague        branches: [master]
51bddf797SDerick Montaguejobs:
61bddf797SDerick Montague    build:
71bddf797SDerick Montague        runs-on: ubuntu-latest
81bddf797SDerick Montague
91bddf797SDerick Montague        steps:
101bddf797SDerick Montague            - uses: actions/checkout@v2
111bddf797SDerick Montague
121bddf797SDerick Montague            - name: Generate static vuepress files
131bddf797SDerick Montague              uses: actions/setup-node@v1
141bddf797SDerick Montague              with:
15*7385e139SPatrick Williams                  node-version: "12.x"
161bddf797SDerick Montague            - run: npm ci
171bddf797SDerick Montague            - run: npm run docs:build
181bddf797SDerick Montague
191bddf797SDerick Montague            - name: Init new repo in dist folder and commit generated files
201bddf797SDerick Montague              run: |
211bddf797SDerick Montague                  cd docs/.vuepress/dist
221bddf797SDerick Montague                  git init
231bddf797SDerick Montague                  git add -A
241bddf797SDerick Montague                  git config --local user.email "action@github.com"
251bddf797SDerick Montague                  git config --local user.name "GitHub Action"
261bddf797SDerick Montague                  git commit -m 'deploy'
271bddf797SDerick Montague
281bddf797SDerick Montague            - name: Force push to gh-pages branch
291bddf797SDerick Montague              uses: ad-m/github-push-action@v0.5.0
301bddf797SDerick Montague              with:
311bddf797SDerick Montague                  github_token: ${{ secrets.GITHUB_TOKEN }}
321bddf797SDerick Montague                  branch: gh-pages
331bddf797SDerick Montague                  force: true
341bddf797SDerick Montague                  directory: ./docs/.vuepress/dist
35