build-stage.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # This is a basic workflow to help you get started with Actions
  2. name: Build-Stage
  3. on:
  4. # push:
  5. # branches: [master, stage]
  6. workflow_dispatch:
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. env:
  11. asset-path: ${GITHUB_REF##*/}/static/js/
  12. steps:
  13. - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
  14. - name: Setup Java JDK
  15. uses: actions/[email protected]
  16. with:
  17. java-version: 1.8
  18. - name: Set up Node
  19. uses: actions/setup-node@v2
  20. with:
  21. node-version: 16
  22. - name: Install clojure
  23. run: |
  24. curl -O https://download.clojure.org/install/linux-install-1.10.1.763.sh
  25. chmod +x linux-install-1.10.1.763.sh
  26. sudo ./linux-install-1.10.1.763.sh
  27. - name: Fetch yarn deps
  28. run: yarn cache clean && yarn install --frozen-lockfile
  29. - name: Build Released-Web
  30. run: |
  31. 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}}'
  32. ls -ah ./static/js
  33. - name: Publish to Cloudflare Pages
  34. uses: cloudflare/pages-action@1
  35. with:
  36. apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
  37. accountId: 2553ea8236c11ea0f88de28fce1cbfee
  38. projectName: 'logseq-demo'
  39. directory: 'static'
  40. gitHubToken: ${{ secrets.GITHUB_TOKEN }}
  41. branch: 'production'