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