From 34c8f60375d68949f8568466a101c1d4bc6c20a2 Mon Sep 17 00:00:00 2001 From: Wesley Luyten Date: Mon, 26 Feb 2024 19:13:42 -0600 Subject: [PATCH] chore(github-pages): add demo preview (#1747) * chore(github-pages): add demo preview * chore(github-pages): try diff env * chore(github-pages): fix permission --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4981cc7..77eb9199 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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