diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 5fc1c6c..969d30f 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,20 +1,51 @@ -name: Build and Deploy -on: [push] +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages permissions: - contents: write -jobs: - build-and-deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v3 + contents: read + pages: write + id-token: write - - name: Install and Build - run: | - npm install - npm run build +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4 - with: - folder: dist # The folder the action should deploy. +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "npm" + - name: Install dependencies + run: npm install + - name: Build + run: npm run build + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + # Upload dist repository + path: "./dist" + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/vite.config.ts b/vite.config.ts index cda7533..2be4230 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,6 +4,7 @@ import { VitePWA } from "vite-plugin-pwa"; // https://vitejs.dev/config/ export default defineConfig({ + base: "/anode/", plugins: [ react(), VitePWA({