Fix springy-boxes demo (#48) #113
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: {} | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build-job: | |
runs-on: ubuntu-latest | |
# Cancel multiple runs when pushing to main | |
concurrency: | |
group: ${{ github.event_name != 'pull_request' && 'group-pushmain' || github.run_id }} | |
cancel-in-progress: ${{ github.event_name != 'pull_request' }} | |
# container: | |
# image: ghcr.io/pmndrs/playwright:main | |
# credentials: | |
# username: ${{ github.actor }} | |
# password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
# Build | |
- uses: actions/checkout@v4 | |
- id: configurepages | |
uses: actions/configure-pages@v5 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
cache: "npm" | |
- run: npm ci | |
- uses: rharkor/[email protected] | |
- run: npm run build | |
env: | |
BASE_PATH: ${{ steps.configurepages.outputs.base_path }} | |
PUBLIC_URL: ${{ steps.configurepages.outputs.base_url }} | |
# Tests (only for PRs) | |
- run: ./test.sh | |
if: github.event_name == 'pull_request' | |
env: | |
BASE_PATH: ${{ steps.configurepages.outputs.base_path }} | |
# Upload artifact (only for pushes on main) | |
- uses: actions/upload-pages-artifact@v3 | |
if: github.event_name != 'pull_request' | |
with: | |
path: ./out${{ steps.configurepages.outputs.base_path }} | |
deploy-job: | |
# only for pushes on main | |
if: github.event_name != 'pull_request' | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build-job | |
steps: | |
- id: deployment | |
uses: actions/deploy-pages@v4 |