Skip to content

Commit e4462fc

Browse files
authored
chore: deploy to github pages using nix (#6)
1 parent 7219fc0 commit e4462fc

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

.github/workflows/publish.yml

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
name: publish
22

3+
concurrency:
4+
group: "${{ github.workflow }}-${{ github.ref }}"
5+
cancel-in-progress: "${{ github.ref != 'refs/heads/main' }}"
6+
37
on:
8+
workflow_dispatch:
9+
merge_group:
10+
pull_request:
11+
branches:
12+
- main
13+
types:
14+
- opened
15+
- reopened
16+
- synchronize
17+
- ready_for_review
418
push:
5-
branches: [ main ]
19+
branches:
20+
- main
21+
622

723
jobs:
824
build-deploy:
925
runs-on: ubuntu-latest
1026

1127
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-node@v2
14-
with:
15-
node-version: '12'
16-
17-
#- name: Install parcel
18-
# run: |
19-
# sudo npm install -g parcel
20-
21-
- name: Build site
22-
run: |
23-
npm install
24-
npm --version
25-
node --version
26-
npx parcel --version
27-
npx parcel build index.pug --no-optimize
28-
cp wasm_rustfmt_bg.wasm dist
29-
30-
- name: Deploy 🚀
31-
uses: JamesIves/[email protected]
32-
with:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
BRANCH: live # The branch the action should deploy to.
35-
FOLDER: dist # The folder the action should deploy.
28+
- uses: actions/checkout@v4
29+
- uses: DeterminateSystems/nix-installer-action@main
30+
- run: nix build
31+
- name: Deploy 🚀
32+
if: github.ref == 'refs/heads/main'
33+
uses: JamesIves/[email protected]
34+
with:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
BRANCH: live # The branch the action should deploy to.
37+
FOLDER: result # The folder the action should deploy.

0 commit comments

Comments
 (0)