deploy-h5.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: Deploy Pages
  2. on:
  3. # Runs on pushes targeting the default branch
  4. push:
  5. branches: ['main']
  6. # Allows you to run this workflow manually from the Actions tab
  7. workflow_dispatch:
  8. # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
  9. permissions:
  10. contents: read
  11. pages: write
  12. id-token: write
  13. jobs:
  14. # Build job
  15. build:
  16. runs-on: ubuntu-latest
  17. steps:
  18. # 设置服务器时区为东八区
  19. - name: Set time zone
  20. run: sudo timedatectl set-timezone 'Asia/Shanghai'
  21. - uses: actions/checkout@v4
  22. - uses: pnpm/action-setup@v2
  23. with:
  24. version: 8
  25. - uses: actions/setup-node@v4
  26. with:
  27. node-version: '18'
  28. cache: 'pnpm'
  29. - name: Install dependencies
  30. run: pnpm i --no-frozen-lockfile
  31. - name: Build
  32. run: pnpm build:h5
  33. - name: Upload artifact
  34. uses: actions/upload-pages-artifact@v3
  35. with:
  36. path: ./dist/build/h5
  37. # Deployment job
  38. deploy:
  39. environment:
  40. name: github-pages
  41. url: ${{ steps.deployment.outputs.page_url }}
  42. runs-on: ubuntu-latest
  43. needs: build
  44. steps:
  45. - name: Deploy to GitHub Pages
  46. id: deployment
  47. uses: actions/deploy-pages@v4