deploy-github-pages.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: "Deploy to GitHub Pages"
  2. on:
  3. workflow_dispatch:
  4. push:
  5. branches:
  6. - develop
  7. jobs:
  8. build:
  9. name: Build
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Set up Node.js
  13. uses: actions/setup-node@v4
  14. env:
  15. NODE_AUTH_TOKEN: ${{ github.token }}
  16. with:
  17. node-version: 20.x
  18. - name: Checkout repository
  19. uses: actions/checkout@v4
  20. - name: Set auth token
  21. run: echo '//npm.pkg.github.com/:_authToken=${{ secrets.GH_PAT }}' >> .npmrc
  22. - name: Install dependencies
  23. run: npm ci
  24. - name: Build statics
  25. run: npm run build
  26. - name: Upload artifact
  27. uses: actions/upload-pages-artifact@v3
  28. with:
  29. name: github-pages
  30. path: dist/
  31. retention-days: 3
  32. # https://github.com/actions/deploy-pages?tab=readme-ov-file#usage
  33. deploy:
  34. name: Deploy
  35. needs: build
  36. permissions:
  37. pages: write
  38. id-token: write
  39. runs-on: ubuntu-latest
  40. steps:
  41. - name: Deploy to GitHub Pages
  42. id: deployment
  43. uses: actions/deploy-pages@v4