From 5012d0f120242144fe4379613be3b8873196b504 Mon Sep 17 00:00:00 2001 From: merrylmr <736633757@qq.com> Date: Tue, 9 Jan 2024 17:46:49 +0800 Subject: [PATCH 1/4] Create main.yml --- .github/workflows/main.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7192c59 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,28 @@ +name: CI +on: + push: + branches: + - master + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + persist-credentials: false + + # react项目为npm run-script build,vue项目改为npm run build + - name: Install and Build + run: | + npm install + npm run-script build + + # react项目的FOLDER为build,vue项目改为dist + - name: Deploy + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + ACCESS_TOKEN: ${{ secrets.CI }} + BRANCH: gh-pages + FOLDER: dist From 96090ee18fdae83181fcfb0aefadc6ee570ab2a3 Mon Sep 17 00:00:00 2001 From: merrylmr <736633757@qq.com> Date: Tue, 9 Jan 2024 17:57:58 +0800 Subject: [PATCH 2/4] Update main.yml --- .github/workflows/main.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7192c59..01e9d32 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,12 +12,15 @@ jobs: uses: actions/checkout@v2 with: persist-credentials: false - + - name: use node + uses: actions/setup-node@v2 + with: + node-version: 14 # node版本 # react项目为npm run-script build,vue项目改为npm run build - name: Install and Build run: | npm install - npm run-script build + npm run docs:build # react项目的FOLDER为build,vue项目改为dist - name: Deploy @@ -25,4 +28,4 @@ jobs: with: ACCESS_TOKEN: ${{ secrets.CI }} BRANCH: gh-pages - FOLDER: dist + FOLDER: /dist From 62facf3acf8c07ad66e28efc3099e895ddcc8f1f Mon Sep 17 00:00:00 2001 From: merrylmr <736633757@qq.com> Date: Tue, 9 Jan 2024 17:59:27 +0800 Subject: [PATCH 3/4] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 01e9d32..4e6fc87 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: - name: Install and Build run: | npm install - npm run docs:build + npm run build # react项目的FOLDER为build,vue项目改为dist - name: Deploy From 846bfc08a560cea9397b44d52394e8e4fe59f783 Mon Sep 17 00:00:00 2001 From: merrylmr <736633757@qq.com> Date: Tue, 9 Jan 2024 18:02:52 +0800 Subject: [PATCH 4/4] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e6fc87..e9ab2e4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,4 +28,4 @@ jobs: with: ACCESS_TOKEN: ${{ secrets.CI }} BRANCH: gh-pages - FOLDER: /dist + FOLDER: dist