deploy.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. name: Deploy Website on push
  2. on:
  3. push:
  4. branches:
  5. - main
  6. jobs:
  7. deploy-playground-ftp:
  8. name: Deploy Push Playground Ftp
  9. if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Checkout code
  13. uses: actions/checkout@v4
  14. with:
  15. fetch-depth: 0
  16. - name: Sed Config Base
  17. shell: bash
  18. run: |
  19. sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./playground/.env.production
  20. sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./playground/.env.production
  21. cat ./playground/.env.production
  22. - name: Setup Node
  23. uses: ./.github/actions/setup-node
  24. - name: Build
  25. run: pnpm build:play
  26. - name: Sync Playground files
  27. uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  28. with:
  29. server: ${{ secrets.PRO_FTP_HOST }}
  30. username: ${{ secrets.WEB_PLAYGROUND_FTP_ACCOUNT }}
  31. password: ${{ secrets.WEB_PLAYGROUND_FTP_PWSSWORD }}
  32. local-dir: ./playground/dist/
  33. deploy-docs-ftp:
  34. name: Deploy Push Docs Ftp
  35. if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
  36. runs-on: ubuntu-latest
  37. steps:
  38. - name: Checkout code
  39. uses: actions/checkout@v4
  40. with:
  41. fetch-depth: 0
  42. - name: Setup Node
  43. uses: ./.github/actions/setup-node
  44. - name: Build
  45. run: pnpm build:docs
  46. - name: Sync Docs files
  47. uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  48. with:
  49. server: ${{ secrets.PRO_FTP_HOST }}
  50. username: ${{ secrets.WEBSITE_FTP_ACCOUNT }}
  51. password: ${{ secrets.WEBSITE_FTP_PASSWORD }}
  52. local-dir: ./docs/.vitepress/dist/
  53. deploy-antd-ftp:
  54. name: Deploy Push Antd Ftp
  55. if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
  56. runs-on: ubuntu-latest
  57. steps:
  58. - name: Checkout code
  59. uses: actions/checkout@v4
  60. with:
  61. fetch-depth: 0
  62. - name: Sed Config Base
  63. shell: bash
  64. run: |
  65. sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-antd/.env.production
  66. sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-antd/.env.production
  67. cat ./apps/web-antd/.env.production
  68. - name: Setup Node
  69. uses: ./.github/actions/setup-node
  70. - name: Build
  71. run: pnpm run build:antd
  72. - name: Sync files
  73. uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  74. with:
  75. server: ${{ secrets.PRO_FTP_HOST }}
  76. username: ${{ secrets.WEB_ANTD_FTP_ACCOUNT }}
  77. password: ${{ secrets.WEB_ANTD_FTP_PASSWORD }}
  78. local-dir: ./apps/web-antd/dist/
  79. deploy-ele-ftp:
  80. name: Deploy Push Element Ftp
  81. if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
  82. runs-on: ubuntu-latest
  83. steps:
  84. - name: Checkout code
  85. uses: actions/checkout@v4
  86. with:
  87. fetch-depth: 0
  88. - name: Sed Config Base
  89. shell: bash
  90. run: |
  91. sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-ele/.env.production
  92. sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-ele/.env.production
  93. cat ./apps/web-ele/.env.production
  94. - name: Setup Node
  95. uses: ./.github/actions/setup-node
  96. - name: Build
  97. run: pnpm run build:ele
  98. - name: Sync files
  99. uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  100. with:
  101. server: ${{ secrets.PRO_FTP_HOST }}
  102. username: ${{ secrets.WEB_ELE_FTP_ACCOUNT }}
  103. password: ${{ secrets.WEB_ELE_FTP_PASSWORD }}
  104. local-dir: ./apps/web-ele/dist/
  105. deploy-naive-ftp:
  106. name: Deploy Push Naive Ftp
  107. if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
  108. runs-on: ubuntu-latest
  109. steps:
  110. - name: Checkout code
  111. uses: actions/checkout@v4
  112. with:
  113. fetch-depth: 0
  114. - name: Sed Config Base
  115. shell: bash
  116. run: |
  117. sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-naive/.env.production
  118. sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-naive/.env.production
  119. cat ./apps/web-naive/.env.production
  120. - name: Setup Node
  121. uses: ./.github/actions/setup-node
  122. - name: Build
  123. run: pnpm run build:naive
  124. - name: Sync files
  125. uses: SamKirkland/FTP-Deploy-Action@v4.3.5
  126. with:
  127. server: ${{ secrets.PRO_FTP_HOST }}
  128. username: ${{ secrets.WEB_NAIVE_FTP_ACCOUNT }}
  129. password: ${{ secrets.WEB_NAIVE_FTP_PASSWORD }}
  130. local-dir: ./apps/web-naive/dist/
  131. rerun-on-failure:
  132. name: Rerun on failure
  133. needs:
  134. - deploy-playground-ftp
  135. - deploy-docs-ftp
  136. - deploy-antd-ftp
  137. - deploy-ele-ftp
  138. - deploy-naive-ftp
  139. if: failure() && fromJSON(github.run_attempt) < 10
  140. runs-on: ubuntu-latest
  141. steps:
  142. - name: Retry ${{ fromJSON(github.run_attempt) }} of 10
  143. env:
  144. GH_REPO: ${{ github.repository }}
  145. GH_TOKEN: ${{ github.token }}
  146. run: gh workflow run rerun.yml -F run_id=${{ github.run_id }}