github actions改用 JamesIves/github-pages-deploy-action@v4 脚本部署 #32
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 GitHub Pages | |
on: | |
push: | |
branches: | |
- master | |
# 任务 | |
jobs: | |
build-and-deploy: | |
# 服务器环境:最新版 Ubuntu | |
runs-on: ubuntu-latest | |
steps: | |
# 拉取代码 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 14.21.3 | |
# 1、生成静态文件 | |
- name: Install and Build | |
run: yarn install && yarn build | |
# 2、部署到 GitHub Pages | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
# ssh-key: ${{ secrets.DEPLOY_KEY }} | |
# ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
repository-name: xmasuhai/meowney-0-website | |
branch: gh-pages | |
folder: dist |