Skip to content

Commit

Permalink
Merge pull request #20 from nixcon/meta/add-gh-pages-previews
Browse files Browse the repository at this point in the history
meta/add-gh-pages-previews
  • Loading branch information
davidnuon authored Jan 11, 2024
2 parents 94b0cb1 + a05fec6 commit 9f749b3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Build
name: Build and Preview

on:
pull_request_target:
types: [edited, opened, synchronize, reopened]
types:
- edited
- opened
- synchronize
- reopened
- closed

jobs:
build:
Expand All @@ -22,13 +27,19 @@ jobs:
- run: npm i

- name: Build
if: github.event.action != 'closed'
run: |
nix build
- name: Copy build result
run: |
cp -rv $(readlink -f result) out
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./out/

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
clean-exclude: pr-preview/

0 comments on commit 9f749b3

Please sign in to comment.