deploy.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Deploy Website on push
  2. on:
  3. push:
  4. branches:
  5. - main
  6. jobs:
  7. deploy-web-antd-ftp:
  8. name: Deploy Web Antd
  9. if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]')
  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 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. dangerous-clean-slate: true