forked from logseq/logseq
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 1.94 KB
/
build-stage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This is a basic workflow to help you get started with Actions
name: Build-Stage
on:
workflow_dispatch:
inputs:
git-ref:
description: "Release Git Ref (Which branch or tag to build?)"
required: true
default: "master"
cloudflare-project-name:
description: "Cloudflare pages project name"
required: true
default: "logseq-demo"
release:
types: [released]
env:
CLOJURE_VERSION: '1.11.1.1413'
NODE_VERSION: '18'
JAVA_VERSION: '17'
jobs:
build:
runs-on: ubuntu-latest
env:
asset-path: ${GITHUB_REF##*/}/static/js/
steps:
- 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'
java-version: ${{ env.JAVA_VERSION }}
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup clojure
uses: DeLaGuardo/[email protected]
with:
cli: ${{ env.CLOJURE_VERSION }}
- name: Fetch yarn deps
run: yarn cache clean && yarn install --frozen-lockfile
- name: Build Released-Web
run: |
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 ./static/js
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 2553ea8236c11ea0f88de28fce1cbfee
projectName: ${{ github.event.inputs.cloudflare-project-name || 'logseq-demo' }}
directory: 'static'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: 'production'