deploy-db-pages.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. name: Deploy DB Version to Cloud
  2. on:
  3. push:
  4. branches: ["feat/db"]
  5. env:
  6. CLOJURE_VERSION: "1.11.1.1413"
  7. NODE_VERSION: '20'
  8. JAVA_VERSION: "11"
  9. jobs:
  10. build-and-deploy:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v3
  14. - name: Setup Java JDK
  15. uses: actions/setup-java@v3
  16. with:
  17. distribution: "zulu"
  18. java-version: ${{ env.JAVA_VERSION }}
  19. - name: Set up Node
  20. uses: actions/setup-node@v3
  21. with:
  22. node-version: ${{ env.NODE_VERSION }}
  23. - name: Setup clojure
  24. uses: DeLaGuardo/[email protected]
  25. with:
  26. cli: ${{ env.CLOJURE_VERSION }}
  27. - name: Fetch yarn deps
  28. run: yarn install --frozen-lockfile
  29. - name: Set Build Environment Variables
  30. run: |
  31. echo "ENABLE_FILE_SYNC_PRODUCTION=false" >> $GITHUB_ENV
  32. - name: Build Released-Web
  33. run: |
  34. yarn gulp:build && clojure -M:cljs release app --config-merge '{:compiler-options {:source-map-include-sources-content true :source-map-detail-level :symbols}}'
  35. rsync -avz --exclude node_modules --exclude android --exclude ios ./static/ ./public/static/
  36. ls -lR ./public && mkdir r2 && mv ./public/static/js/main.js.map ./r2/db-demo.main.js.map
  37. sed -i 's/=main.js.map/=https:\/\/assets.logseq.io\/db-demo.main.js.map/g' ./public/static/js/main.js
  38. env:
  39. LOGSEQ_SENTRY_DSN: ${{ secrets.LOGSEQ_SENTRY_DSN }}
  40. LOGSEQ_POSTHOG_TOKEN: ${{ secrets.LOGSEQ_POSTHOG_TOKEN }}
  41. - name: Upload to R2
  42. uses: ryand56/r2-upload-action@latest
  43. with:
  44. r2-account-id: 2553ea8236c11ea0f88de28fce1cbfee
  45. r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
  46. r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
  47. r2-bucket: ${{ secrets.R2_ASSETS_BUCKET }}
  48. source-dir: r2
  49. destination-dir: ./
  50. - name: Publish to Cloudflare Pages
  51. uses: cloudflare/pages-action@1
  52. with:
  53. apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
  54. accountId: 2553ea8236c11ea0f88de28fce1cbfee
  55. projectName: "logseq-db-demo"
  56. directory: "public"
  57. gitHubToken: ${{ secrets.GITHUB_TOKEN }}
  58. branch: "main"