Skip to content

Merge pull request #48 from u2/main-1 #168

Merge pull request #48 from u2/main-1

Merge pull request #48 from u2/main-1 #168

Workflow file for this run

name: deploy
on:
push:
branches:
- main
- vuepress
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
env:
NODE_VERSION: '16'
CUSTOM_CNAME: 'docs.did.id'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
# - name: Cache dependencies
# uses: actions/cache@v2
# id: cache-node-modules
# with:
# path: |
# **/node_modules
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
# restore-keys: |
# ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
- name: Install dependencies
run: npm install
- name: Build documentation site
run: npm run build
- name: Output cname
run: echo ${{env.CUSTOM_CNAME}} > .vuepress/dist/CNAME
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: .vuepress/dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}