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