name: docs on: # trigger deployment on every push to main branch push: branches: [docs] # trigger deployment manually workflow_dispatch: permissions: pages: write contents: write repository-projects: write jobs: docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: # fetch all commits to get last updated time or other git log info fetch-depth: 0 ref: docs # - name: Setup pnpm # uses: pnpm/action-setup@v2 # with: # # choose pnpm version to use # version: 7 # # install deps with pnpm # run_install: true - name: Setup Node.js uses: actions/setup-node@v3 with: # choose node.js version to use node-version: 18 cache: npm # run build script - name: Build VuePress site run: | npm install npm run build - name: Setup Pages uses: actions/configure-pages@v3 - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: # Upload entire repository path: './docs/.vuepress/dist' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2