|
|
@@ -1,8 +1,8 @@
|
|
|
-name: Deploy master to cloudflare pages for test
|
|
|
+# This is a basic workflow to help you get started with Actions
|
|
|
+
|
|
|
+name: Build-Demo
|
|
|
|
|
|
on:
|
|
|
- push:
|
|
|
- branches: [ "master" ]
|
|
|
workflow_dispatch:
|
|
|
inputs:
|
|
|
git-ref:
|
|
|
@@ -12,33 +12,40 @@ on:
|
|
|
cloudflare-project-name:
|
|
|
description: "Cloudflare pages project name"
|
|
|
required: true
|
|
|
- default: "logseq-dev"
|
|
|
+ default: "logseq-demo"
|
|
|
+
|
|
|
+ release:
|
|
|
+ types: [released]
|
|
|
|
|
|
env:
|
|
|
- CLOJURE_VERSION: "1.10.1.763"
|
|
|
- NODE_VERSION: "18"
|
|
|
- JAVA_VERSION: "11"
|
|
|
+ CLOJURE_VERSION: '1.11.1.1413'
|
|
|
+ NODE_VERSION: '18'
|
|
|
+ JAVA_VERSION: '17'
|
|
|
|
|
|
jobs:
|
|
|
- build-and-deploy:
|
|
|
+ build:
|
|
|
runs-on: ubuntu-latest
|
|
|
+ env:
|
|
|
+ asset-path: ${GITHUB_REF##*/}/static/js/
|
|
|
|
|
|
steps:
|
|
|
- - uses: actions/checkout@v3
|
|
|
+ - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
|
|
+ with:
|
|
|
+ ref: ${{ github.event.inputs.git-ref }}
|
|
|
|
|
|
- name: Setup Java JDK
|
|
|
uses: actions/setup-java@v3
|
|
|
with:
|
|
|
- distribution: "zulu"
|
|
|
+ distribution: 'zulu'
|
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
|
|
|
|
- - name: Set up Node
|
|
|
+ - name: Install Node.js, NPM and Yarn
|
|
|
uses: actions/setup-node@v3
|
|
|
with:
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
|
|
- name: Setup clojure
|
|
|
- uses: DeLaGuardo/setup-clojure@11.0
|
|
|
+ uses: DeLaGuardo/setup-clojure@10.1
|
|
|
with:
|
|
|
cli: ${{ env.CLOJURE_VERSION }}
|
|
|
|
|
|
@@ -47,16 +54,15 @@ jobs:
|
|
|
|
|
|
- name: Build Released-Web
|
|
|
run: |
|
|
|
- yarn gulp:build && clojure -M:cljs release app --config-merge '{:compiler-options {:source-map-include-sources-content false :source-map-detail-level :symbols}}'
|
|
|
- rsync -avz --exclude node_modules --exclude '*.js.map' --exclude android --exclude ios ./static/ ./public/static/
|
|
|
- ls -lR ./public
|
|
|
+ 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}}'
|
|
|
+ ls -ah ./public
|
|
|
|
|
|
- name: Publish to Cloudflare Pages
|
|
|
uses: cloudflare/pages-action@1
|
|
|
with:
|
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
|
accountId: 2553ea8236c11ea0f88de28fce1cbfee
|
|
|
- projectName: "logseq-dev"
|
|
|
- directory: "public"
|
|
|
+ projectName: ${{ github.event.inputs.cloudflare-project-name || 'logseq-demo' }}
|
|
|
+ directory: 'static'
|
|
|
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
|
- branch: "production"
|
|
|
+ branch: 'production'
|