main.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Build
  2. on:
  3. push:
  4. branches:
  5. - master
  6. schedule:
  7. - cron: '0 12 * * *'
  8. jobs:
  9. build:
  10. runs-on: ubuntu-latest
  11. strategy:
  12. matrix:
  13. node-version:
  14. - 16.x
  15. steps:
  16. - name: Checkout
  17. uses: actions/checkout@v3
  18. with:
  19. persist-credentials: false
  20. - name: Use Node.js ${{ matrix.node-version }}
  21. uses: actions/setup-node@v3
  22. with:
  23. node-version: ${{ matrix.node-version }}
  24. - uses: pnpm/action-setup@v2
  25. name: Install pnpm
  26. id: pnpm-install
  27. with:
  28. version: 7
  29. run_install: false
  30. - name: Get pnpm store directory
  31. id: pnpm-cache
  32. run: |
  33. echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
  34. - uses: actions/cache@v3
  35. name: Setup pnpm cache
  36. with:
  37. path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
  38. key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
  39. restore-keys: |
  40. ${{ runner.os }}-pnpm-store-
  41. - run: pnpm i
  42. - run: pnpm run build
  43. - name: Deploy
  44. uses: peaceiris/actions-gh-pages@v3
  45. with:
  46. github_token: ${{ secrets.GIT_TOKEN }}
  47. user_name: ${{ secrets.GIT_USER }}
  48. user_email: ${{ secrets.GIT_EMAIL }}
  49. publish_branch: gh-pages
  50. publish_dir: ./
  51. cname: ruleset.skk.moe