Skip to content

Commit

Permalink
fix: github action deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
caidanw committed Feb 25, 2024
1 parent 206d12a commit ae36da3
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/deploy_static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Deploy Svelte static site to GitHub Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
branches: "master"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -23,27 +23,27 @@ concurrency:

jobs:
# Single deploy job since we're just deploying
build:
build_site:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Configure GitHub Pages
uses: actions/[email protected]
with:
# Optional static site generator to attempt to configure: "nuxt", "next", "gatsby", or "sveltekit"
static_site_generator: sveltekit
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
node-version: 20
cache: npm

- name: Install and Build
env:
BASE_PATH: '/${{ github.event.repository.name }}'
run: |
npm ci
npm run build
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v1.0.7
uses: actions/upload-pages-artifact@v3
with:
# Artifact name
name: github-pages
Expand All @@ -53,11 +53,13 @@ jobs:
retention-days: 1

deploy:
needs: build_site
runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build

steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down

0 comments on commit ae36da3

Please sign in to comment.