Fix astro build to support gh-pages

This commit is contained in:
Carter McBride 2024-08-23 15:39:57 -06:00
parent f98eb00a97
commit ce3d87d8e3
2 changed files with 18 additions and 23 deletions

View file

@ -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 name: Deploy to GitHub Pages
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Build feed
on: on:
workflow_dispatch: # Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branchs name
push: push:
branches: branches: [main]
- main # Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Build every 6 hours
schedule: schedule:
- cron: "0 */6 * * *" # At minute 0 past every 6th hour. - cron: "0 */6 * * *" # At minute 0 past every 6th hour.
# Allow this job to clone the repo and create a page deployment
permissions: permissions:
contents: read
pages: write pages: write
id-token: write id-token: write
@ -21,26 +23,17 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Checkout your repository using git
- name: Setup Bun uses: actions/checkout@v4
uses: oven-sh/setup-bun@v1 - name: Install, build, and upload your site output
with: uses: withastro/action@v2
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/
deploy: deploy:
needs: build
runs-on: ubuntu-latest
environment: environment:
name: github-pages name: github-pages
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps: steps:
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
id: deployment id: deployment

View file

@ -3,6 +3,8 @@ import { defineConfig } from "astro/config";
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: "https://carterworks.github.io/",
base: "rss-reader",
output: "static", output: "static",
integrations: [tailwindIntegration()], integrations: [tailwindIntegration()],
}); });