-
-
Save Valexr/f75a747dbe024b8aad71c8fc48bce4db to your computer and use it in GitHub Desktop.
Github Actions Workflow Deploy SvelteKit Github Pages
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: 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