From e609ce4cf423092c12b5c24acb2055950f2c21e6 Mon Sep 17 00:00:00 2001 From: Phyuany Date: Thu, 7 Nov 2024 00:56:35 +0800 Subject: [PATCH] Update deploy.yml --- .github/workflows/deploy.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index aeb4f8d..bc8ddb8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,6 +6,7 @@ on: - main # 监听 main 分支的 push 事件 jobs: + # Build job build: runs-on: ubuntu-latest @@ -30,9 +31,21 @@ jobs: run: | gulp dist --codelabs-dir=codelabs # 运行打包命令 - # Step 5 (Alternative for GitHub Pages): - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + # Step 5: Upload dist folder + - name: Upload static files as artifact + id: deployment + uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist + path: dist/ + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1