deploy-db-test-pages.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. name: Deploy DB Test Version to Cloud
  2. on:
  3. push:
  4. branches: ["test/db"]
  5. env:
  6. CLOJURE_VERSION: "1.11.1.1413"
  7. NODE_VERSION: '22'
  8. JAVA_VERSION: "11"
  9. jobs:
  10. build-and-deploy:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/download-artifact@v4
  14. with:
  15. name: e2e-success
  16. path: .
  17. continue-on-error: true
  18. # FIXME: download not found for successful e2e
  19. # - name: Check E2E success
  20. # run: |
  21. # if [ ! -f e2e-success.txt ]; then
  22. # echo "❌ E2E tests did not succeed — aborting release."
  23. # exit 1
  24. # fi
  25. - uses: actions/checkout@v4
  26. - name: Setup Java JDK
  27. uses: actions/setup-java@v4
  28. with:
  29. distribution: "zulu"
  30. java-version: ${{ env.JAVA_VERSION }}
  31. - name: Set up Node
  32. uses: actions/setup-node@v4
  33. with:
  34. node-version: ${{ env.NODE_VERSION }}
  35. - name: Setup clojure
  36. uses: DeLaGuardo/[email protected]
  37. with:
  38. cli: ${{ env.CLOJURE_VERSION }}
  39. - name: Fetch yarn deps
  40. run: yarn install --frozen-lockfile
  41. - name: Set Build Environment Variables
  42. run: |
  43. echo "ENABLE_FILE_SYNC_PRODUCTION=true" >> $GITHUB_ENV
  44. echo "ENABLE_RTC_SYNC_PRODUCTION=true" >> $GITHUB_ENV
  45. - name: Build Released-Web
  46. run: |
  47. yarn gulp:build && clojure -M:cljs release app db-worker inference-worker --config-merge '{:compiler-options {:source-map true :source-map-include-sources-content true :source-map-detail-level :symbols}}' && yarn webpack-app-build
  48. rsync -avz --exclude node_modules --exclude android --exclude ios --exclude mobile ./static/ ./public/
  49. ls -lR ./public && mkdir r2 && mv ./public/js/main.js.map ./r2/db-test.main.js.map
  50. sed -i 's/=main.js.map/=https:\/\/assets.logseq.io\/db-test.main.js.map/g' ./public/js/main.js
  51. env:
  52. LOGSEQ_SENTRY_DSN: ${{ secrets.LOGSEQ_SENTRY_DSN }}
  53. LOGSEQ_POSTHOG_TOKEN: ${{ secrets.LOGSEQ_POSTHOG_TOKEN }}
  54. - name: Upload to R2
  55. uses: ryand56/r2-upload-action@latest
  56. with:
  57. r2-account-id: 2553ea8236c11ea0f88de28fce1cbfee
  58. r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
  59. r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
  60. r2-bucket: ${{ secrets.R2_ASSETS_BUCKET }}
  61. source-dir: r2
  62. destination-dir: ./
  63. - name: Publish to Cloudflare Pages
  64. uses: cloudflare/pages-action@1
  65. with:
  66. apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
  67. accountId: 2553ea8236c11ea0f88de28fce1cbfee
  68. projectName: " logseq-db-test"
  69. directory: "public"
  70. gitHubToken: ${{ secrets.GITHUB_TOKEN }}
  71. branch: "main"