@@ -45,10 +45,13 @@ jobs:
45
45
- name : pre-commit-check
46
46
run : |
47
47
nix build -L .#pre-commit-check
48
- live-wasm :
48
+ live :
49
49
needs : lint
50
- name : Build Ormolu WASM
50
+ name : Build and deploy Ormolu Live
51
51
runs-on : ubuntu-latest
52
+ env :
53
+ NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
54
+ NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
52
55
steps :
53
56
- uses : actions/checkout@v4
54
57
- uses : cachix/install-nix-action@v30
@@ -64,54 +67,16 @@ jobs:
64
67
restore-keys : |
65
68
wasm-${{ github.run_id }}
66
69
wasm-
67
- - name : Build Ormolu WASM
70
+ - name : Build Ormolu Live
68
71
run : |
69
72
cd ormolu-live
70
- nix develop .#ghcWasm -c sh -c \
71
- 'wasm32-wasi-cabal update && ./build-wasm.sh -Oz'
72
- - uses : actions/upload-artifact@v4
73
- with :
74
- name : wasm
75
- path : ormolu-live/src/ormolu.wasm
76
- live-frontend :
77
- needs : lint
78
- name : Build Ormolu Live frontend
79
- runs-on : ubuntu-latest
80
- steps :
81
- - uses : actions/checkout@v4
82
- - uses : cachix/install-nix-action@v30
83
- with :
84
- extra_nix_config : |
85
- accept-flake-config = true
86
- - uses : cachix/cachix-action@v15
87
- with :
88
- name : tweag-ormolu
89
- authToken : ' ${{ secrets.CACHIX_TWEAG_ORMOLU_AUTH_TOKEN }}'
90
- - name : Build frontend
91
- run : |
92
- nix build -L .#ormoluLive
93
- cp -r --no-preserve=mode,ownership result/ site
94
- - uses : actions/upload-artifact@v4
95
- with :
96
- name : frontend
97
- path : site/
98
- live-deploy :
99
- needs : [live-wasm, live-frontend]
100
- name : Deploy Ormolu Live
101
- runs-on : ubuntu-latest
102
- env :
103
- NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
104
- NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
105
- steps :
106
- - uses : actions/download-artifact@v4
107
- - name : Combine
108
- run : |
109
- cp wasm/ormolu.wasm frontend/ormolu.*.wasm
73
+ nix develop .#ormoluLive -c sh -c \
74
+ 'npm ci && wasm32-wasi-cabal update && ./build.sh prod'
110
75
- name : Deploy to Netlify, preview
111
76
if : env.NETLIFY_AUTH_TOKEN != ''
112
77
uses : nwtgck/actions-netlify@v3
113
78
with :
114
- publish-dir : ./frontend
79
+ publish-dir : ./ormolu-live/dist
115
80
github-token : ${{ secrets.GITHUB_TOKEN }}
116
81
alias : ${{ github.event.pull_request.head.sha || github.sha }}
117
82
enable-pull-request-comment : true
120
85
- name : Deploy to Netlify, production
121
86
if : env.NETLIFY_AUTH_TOKEN != '' && github.ref == 'refs/heads/master'
122
87
run : |
123
- netlify deploy --prod -d ./frontend
88
+ netlify deploy --prod -d ./ormolu-live/dist
124
89
125
90
# prevent stack.yaml from becoming outdated
126
91
stack :
0 commit comments