File tree Expand file tree Collapse file tree 4 files changed +32
-12
lines changed
Expand file tree Collapse file tree 4 files changed +32
-12
lines changed Original file line number Diff line number Diff line change 1- name : Build and Bundle
1+ name : Make Self Host Zip
22
33on :
44 workflow_dispatch :
@@ -26,18 +26,18 @@ jobs:
2626
2727 - name : Bundle server.js
2828 run : |
29- pnpm esbuild server.js --bundle --platform=node --outfile=bundled-server.js
29+ pnpm esbuild server.js --bundle --platform=node --outfile=bundled-server.js --define=process.env.NODE_ENV="production"
3030
3131 - name : Create distribution package
3232 run : |
3333 mkdir -p package
3434 cp -r dist package/
3535 cp bundled-server.js package/server.js
3636 cd package
37- zip -r ../dist-package .zip .
37+ zip -r ../self-host .zip .
3838
3939 - name : Upload artifact
4040 uses : actions/upload-artifact@v4
4141 with :
42- name : dist-package
43- path : dist-package .zip
42+ name : self-host
43+ path : self-host .zip
Original file line number Diff line number Diff line change @@ -43,19 +43,36 @@ jobs:
4343 with :
4444 run : vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --prod
4545 id : deploy
46+ # publish to github
47+ - run : cp vercel.json .vercel/output/static/vercel.json
48+ - uses : peaceiris/actions-gh-pages@v3
49+ with :
50+ github_token : ${{ secrets.GITHUB_TOKEN }}
51+ publish_dir : .vercel/output/static
52+ force_orphan : true
53+
54+ - name : Build self-host version
55+ run : pnpm build
56+ - name : Bundle server.js
57+ run : |
58+ pnpm esbuild server.js --bundle --platform=node --outfile=bundled-server.js --define=process.env.NODE_ENV="production"
59+
60+ - name : Create zip package
61+ run : |
62+ mkdir -p package
63+ cp -r dist package/
64+ cp bundled-server.js package/server.js
65+ cd package
66+ zip -r ../self-host.zip .
67+
4668 - run : |
4769 pnpx zardoy-release node --footer "This release URL: ${{ steps.deploy.outputs.stdout }}"
4870 env:
4971 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5072 # has possible output: tag
5173 id: release
74+
5275 # has output
53- - run : cp vercel.json .vercel/output/static/vercel.json
54- - uses : peaceiris/actions-gh-pages@v3
55- with :
56- github_token : ${{ secrets.GITHUB_TOKEN }}
57- publish_dir : .vercel/output/static
58- force_orphan : true
5976 - name : Set publishing config
6077 run : pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
6178 env :
Original file line number Diff line number Diff line change 3535 " web" ,
3636 " client"
3737 ],
38+ "release" : {
39+ "attachReleaseFiles" : " self-host.zip"
40+ },
3841 "publish" : {
3942 "preset" : {
4043 "publishOnlyIfChanged" : true ,
Original file line number Diff line number Diff line change 1515// Create our app
1616const app = express ( )
1717
18- const isProd = process . argv . includes ( '--prod' )
18+ const isProd = process . argv . includes ( '--prod' ) || process . env . NODE_ENV === 'production'
1919app . use ( compression ( ) )
2020app . use ( cors ( ) )
2121app . use ( netApi ( { allowOrigin : '*' } ) )
You can’t perform that action at this time.
0 commit comments