Skip to content

Commit

Permalink
chore(github-pages): add demo preview (#1747)
Browse files Browse the repository at this point in the history
* chore(github-pages): add demo preview

* chore(github-pages): try diff env

* chore(github-pages): fix permission
  • Loading branch information
luwes committed Feb 27, 2024
1 parent 141b843 commit 34c8f60
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Node.js CI

on: [push, pull_request]

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -56,3 +62,30 @@ jobs:
- run: npm run build:demo
- run: npm run build:dist
- run: npm run build:standalone

deploy-preview:
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-preview
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run build:lib
- run: npm run build:demo
- uses: actions/upload-pages-artifact@v3
with:
path: './demo'
- uses: actions/deploy-pages@v4
id: deployment

0 comments on commit 34c8f60

Please sign in to comment.