Skip to content

Commit

Permalink
fix/cicd: try to fix cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
uptonking committed Dec 28, 2023
1 parent ad77650 commit 1725ccc
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions .github/workflows/deploy-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,30 @@ on:
push:
branches:
- main
- dev

permissions:
contents: write

jobs:
Build:
# 👉🏻 install + build
runs-on: ubuntu-22.04
steps:
- name: checkout code
uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v2
with:
node-version: '18.18'
- run: npm install && npm run build
# 上传打包好的文件,所以下一步可以使用
- name: upload files
uses: actions/upload-artifact@v2
with:
name: build-pages
path: build
retention-days: 1
- name: checkout code
uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v2
with:
node-version: '18.18'
- name: Install and Build
run: npm install && npm run build
# 上传打包好的文件,所以下一步可以使用
- name: upload files
uses: actions/upload-artifact@v2
with:
name: build-pages
path: build
retention-days: 1
Deploy:
# 👉🏻 deploy to github pages
needs: Build # 确保build 阶段完成
Expand All @@ -38,8 +41,8 @@ jobs:
name: build-pages
path: build
- name: deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
branch: gh-spages
folder: build
token: "${{ secrets.EXAMPLES20231229 }}"
token: '${{ secrets.EXAMPLES20231229 }}'

0 comments on commit 1725ccc

Please sign in to comment.