deploy.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-antd/.env.production
  24. cat ./apps/web-antd/.env.production
  25. sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-ele/.env.production
  26. sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-ele/.env.production
  27. cat ./apps/web-ele/.env.production
  28. sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-naive/.env.production
  29. sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-naive/.env.production
  30. cat ./apps/web-naive/.env.production
  31. - name: Install pnpm
  32. uses: pnpm/action-setup@v4
  33. - name: Use Node.js ${{ matrix.node-version }}
  34. uses: actions/setup-node@v4
  35. with:
  36. node-version: ${{ matrix.node-version }}
  37. cache: "pnpm"
  38. - name: Install dependencies
  39. run: pnpm install --frozen-lockfile
  40. - name: Build
  41. run: pnpm run build
  42. - name: Sync Web Antd files
  43. uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  44. with:
  45. server: ${{ secrets.PRO_FTP_HOST }}
  46. username: ${{ secrets.WEB_ANTD_FTP_ACCOUNT }}
  47. password: ${{ secrets.WEB_ANTD_FTP_PASSWORD }}
  48. local-dir: ./apps/web-antd/dist/
  49. - name: Sync Web Naive files
  50. uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  51. with:
  52. server: ${{ secrets.PRO_FTP_HOST }}
  53. username: ${{ secrets.WEB_NAIVE_FTP_ACCOUNT }}
  54. password: ${{ secrets.WEB_NAIVE_FTP_PASSWORD }}
  55. local-dir: ./apps/web-naive/dist/
  56. - name: Sync Web Ele files
  57. uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  58. with:
  59. server: ${{ secrets.PRO_FTP_HOST }}
  60. username: ${{ secrets.WEB_ELE_FTP_ACCOUNT }}
  61. password: ${{ secrets.WEB_ELE_FTP_PASSWORD }}
  62. local-dir: ./apps/web-ele/dist/
  63. - name: Sync Docs files
  64. uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  65. with:
  66. server: ${{ secrets.PRO_FTP_HOST }}
  67. username: ${{ secrets.WEBSITE_FTP_ACCOUNT }}
  68. password: ${{ secrets.WEBSITE_FTP_PASSWORD }}
  69. local-dir: ./docs/.vitepress/dist/