Skip to content

Migrate from vanilla Svelte to SvelteKit #156

Migrate from vanilla Svelte to SvelteKit

Migrate from vanilla Svelte to SvelteKit #156

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
pull_request:
workflow_dispatch:
inputs:
deploy:
description: 'Deploy to GitHub Pages'
required: false
type: boolean
default: true
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# 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:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Build
run: npm run build --if-present
- name: Run tests
run: npm test
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.deploy)
with:
path: ./build
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.deploy)
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4