mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-21 00:42:43 +08:00
59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
name: docs
|
|
|
|
on:
|
|
# trigger deployment on every push to main branch
|
|
push:
|
|
branches: [docs]
|
|
# trigger deployment manually
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
pages: write
|
|
contents: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
docs:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
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
|