fix console button #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Blog | |
on: | |
push: | |
branches: | |
- master | |
env: | |
TZ: Asia/Shanghai | |
# 任务 | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
# 步骤 根据步骤执行任务 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
path: . | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Setup pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 8 | |
- name: Installation dependency | |
run: pnpm install | |
- name: Build Website | |
run: pnpm docs:build | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: my-artifact | |
path: src/.vuepress/dist | |
deploy: | |
name: Deploy | |
runs-on: self-hosted | |
needs: build | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: my-artifact | |
- name: Clean up old files on the website | |
run: sudo rm -rf /www/wwwroot/www/* | |
- name: Import website files | |
run: sudo cp -r * /www/wwwroot/www/ | |
- name: Refresh CDN | |
run: /home/ubuntu/refresh/refresh_www.sh |