Skip to content

Commit

Permalink
feat: set up PR preview (#1547)
Browse files Browse the repository at this point in the history
A GitHub action creates a preview for each pull request by deploying the build project on GitHub Pages
  • Loading branch information
Tamás Russ authored Jul 5, 2024
1 parent 072c916 commit fede42b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy PR previews

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
paths:
- "packages/openscd/**"

concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
permissions: write-all
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install and Build OpenSCD
if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed
run: |
npm i @nx/nx-linux-x64-gnu
npm clean-install
npm run-script build
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: packages/openscd/dist
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ node_modules/
/custom-elements.json
/.tsbuildinfo
/.rollup.cache
/build

# lerna
/lerna-debug.log

.nx/cache
.nx/cache

0 comments on commit fede42b

Please sign in to comment.