build-demo.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # This is a basic workflow to help you get started with Actions
  2. name: Build-Demo
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. git-ref:
  7. description: "Release Git Ref (Which branch or tag to build?)"
  8. required: true
  9. default: "master"
  10. cloudflare-project-name:
  11. description: "Cloudflare pages project name"
  12. required: true
  13. default: "logseq-demo"
  14. release:
  15. types: [released]
  16. env:
  17. CLOJURE_VERSION: '1.11.1.1413'
  18. NODE_VERSION: '22'
  19. JAVA_VERSION: '17'
  20. jobs:
  21. build:
  22. runs-on: ubuntu-latest
  23. env:
  24. asset-path: ${GITHUB_REF##*/}/static/js/
  25. steps:
  26. - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
  27. with:
  28. ref: ${{ github.event.inputs.git-ref }}
  29. - name: Setup Java JDK
  30. uses: actions/setup-java@v3
  31. with:
  32. distribution: 'zulu'
  33. java-version: ${{ env.JAVA_VERSION }}
  34. - name: Install Node.js, NPM and Yarn
  35. uses: actions/setup-node@v3
  36. with:
  37. node-version: ${{ env.NODE_VERSION }}
  38. - name: Setup clojure
  39. uses: DeLaGuardo/[email protected]
  40. with:
  41. cli: ${{ env.CLOJURE_VERSION }}
  42. - name: Fetch yarn deps
  43. run: yarn cache clean && yarn install --frozen-lockfile
  44. - name: Build Released-Web
  45. run: |
  46. yarn gulp:build && clojure -M:cljs release app --config-merge '{:asset-path "${{env.asset-path}}" :compiler-options {:source-map-include-sources-content false :source-map-detail-level :symbols}}'
  47. ls -ah ./public
  48. - name: Publish to Cloudflare Pages
  49. uses: cloudflare/pages-action@1
  50. with:
  51. apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
  52. accountId: 2553ea8236c11ea0f88de28fce1cbfee
  53. projectName: ${{ github.event.inputs.cloudflare-project-name || 'logseq-demo' }}
  54. directory: 'static'
  55. gitHubToken: ${{ secrets.GITHUB_TOKEN }}
  56. branch: 'production'