Skip to content

Instantly share code, notes, and snippets.

@Valexr
Forked from AndrewLester/pages.yml
Created July 11, 2022 14:37
Show Gist options
  • Save Valexr/f75a747dbe024b8aad71c8fc48bce4db to your computer and use it in GitHub Desktop.
Save Valexr/f75a747dbe024b8aad71c8fc48bce4db to your computer and use it in GitHub Desktop.
Github Actions Workflow Deploy SvelteKit Github Pages
name: Build and Deploy to Pages
on:
push:
branches: ['main']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v3
with:
name: build
path: build/
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: gh-pages
- run: rm -rf *
- uses: actions/download-artifact@v3
with:
name: build
- uses: EndBug/add-and-commit@v9.0.0
with:
default_author: github_actions
message: Deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment