From ce3d87d8e304b0a820b5d4296e99f7a0e3bdbb15 Mon Sep 17 00:00:00 2001 From: Carter McBride <18412686+carterworks@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:39:57 -0600 Subject: [PATCH] Fix astro build to support gh-pages --- .github/workflows/build.yml | 39 +++++++++++++++---------------------- astro.config.js | 2 ++ 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a67f31..ddced07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,19 +1,21 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Build feed +name: Deploy to GitHub Pages on: - workflow_dispatch: + # Trigger the workflow every time you push to the `main` branch + # Using a different branch name? Replace `main` with your branch’s name push: - branches: - - main + branches: [main] + # Allows you to run this workflow manually from the Actions tab on GitHub. + workflow_dispatch: + # Build every 6 hours schedule: - cron: "0 */6 * * *" # At minute 0 past every 6th hour. +# Allow this job to clone the repo and create a page deployment permissions: + contents: read pages: write id-token: write @@ -21,26 +23,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Setup Bun - uses: oven-sh/setup-bun@v1 - with: - bun-version: latest - - run: bun install - - run: bun run build - env: - YAZZY_URL: ${{ vars.YAZZY_URL }} - FEEDS: ${{ vars.FEEDS }} - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: dist/ + - name: Checkout your repository using git + uses: actions/checkout@v4 + - name: Install, build, and upload your site output + uses: withastro/action@v2 + deploy: + needs: build + runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build steps: - name: Deploy to GitHub Pages id: deployment diff --git a/astro.config.js b/astro.config.js index 8f1af52..83fe1c2 100644 --- a/astro.config.js +++ b/astro.config.js @@ -3,6 +3,8 @@ import { defineConfig } from "astro/config"; // https://astro.build/config export default defineConfig({ + site: "https://carterworks.github.io/", + base: "rss-reader", output: "static", integrations: [tailwindIntegration()], });