Skip to content

Build and Deploy

Build and Deploy #5

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [ "sveltekit" ]
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: sveltekit
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.17.0
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Deploy to GitHub Pages
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git worktree add gh-pages
cp -r build/* gh-pages/
cd gh-pages
git add .
git commit -m "Deploying build artifacts to gh-pages"
git push origin gh-pages --force