deploy-sync-test.yml 2.7 KB

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