From ae36da3c5344fad9f391030e76349d7997f70a5d Mon Sep 17 00:00:00 2001 From: Caidan Williams Date: Sat, 24 Feb 2024 16:15:55 -0800 Subject: [PATCH] fix: github action deployment --- .github/workflows/deploy_static.yml | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy_static.yml b/.github/workflows/deploy_static.yml index 8ec43a8..d7ad95f 100644 --- a/.github/workflows/deploy_static.yml +++ b/.github/workflows/deploy_static.yml @@ -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: @@ -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/checkout@v3.3.0 - - name: Configure GitHub Pages - uses: actions/configure-pages@v3.0.4 - 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 @@ -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