deploy.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. name: Deploy Website on push
  2. on:
  3. push:
  4. branches:
  5. - main
  6. jobs:
  7. deploy-push-ftp:
  8. name: Deploy Push Ftp
  9. if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && contains(github.event.head_commit.message, '[deploy]')
  10. runs-on: ubuntu-latest
  11. strategy:
  12. matrix:
  13. node-version: [20]
  14. steps:
  15. - name: Checkout code
  16. uses: actions/checkout@v4
  17. with:
  18. fetch-depth: 0
  19. - name: Sed Config Base
  20. shell: bash
  21. run: |
  22. sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-antd/.env.production
  23. cat ./apps/web-antd/.env.production
  24. - name: Install pnpm
  25. uses: pnpm/action-setup@v4
  26. - name: Use Node.js ${{ matrix.node-version }}
  27. uses: actions/setup-node@v4
  28. with:
  29. node-version: ${{ matrix.node-version }}
  30. cache: "pnpm"
  31. - name: Install dependencies
  32. run: pnpm install --frozen-lockfile
  33. - name: Build
  34. run: pnpm run build
  35. - name: Sync Web Antd files
  36. uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  37. with:
  38. server: ${{ secrets.PRO_FTP_HOST }}
  39. username: ${{ secrets.WEB_ANTD_FTP_ACCOUNT }}
  40. password: ${{ secrets.WEB_ANTD_FTP_PASSWORD }}
  41. local-dir: ./apps/web-antd/dist/
  42. - name: Sync Website files
  43. uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  44. with:
  45. server: ${{ secrets.PRO_FTP_HOST }}
  46. username: ${{ secrets.WEBSITE_FTP_ACCOUNT }}
  47. password: ${{ secrets.WEBSITE_FTP_PASSWORD }}
  48. local-dir: ./website/.vitepress/dist/