Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/actions/prepare-site/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Prepare Site
description: Prepare external content collections and synced spreadsheet data for the website build.

runs:
using: composite
steps:
- name: Remove local debug collections
shell: bash
run: |
rm -rf src/collection_people
rm -rf src/collection_projects
rm -rf src/collection_news

- name: Clone marc_people repository
uses: actions/checkout@v5
with:
repository: pdnMARC/marc_people
path: src/collection_people
fetch-depth: 1

- name: Clone marc_projects repository
uses: actions/checkout@v5
with:
repository: pdnMARC/marc_projects
path: src/collection_projects
fetch-depth: 1

- name: Clone marc_news repository
uses: actions/checkout@v5
with:
repository: pdnMARC/marc_news
path: src/collection_news
fetch-depth: 1

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install uv
shell: bash
run: pip install uv

- name: Sync Python dependencies
shell: bash
run: uv sync --frozen

- name: Run Python scripts
shell: bash
run: uv run python_scripts/get_data.py
64 changes: 3 additions & 61 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,83 +17,25 @@ jobs:
runs-on: ubuntu-latest

steps:
# Checkout main Astro repo
- name: Checkout main repository
uses: actions/checkout@v5

# 👇 Add the logging step here
- name: Print trigger info
run: echo "Triggered by ${{ github.event.client_payload.source }}"

# Remove local debug collection
- name: Remove local debug collections
run: |
rm -rf src/collection_people
rm -rf src/collection_projects
rm -rf src/collection_news
- name: Prepare site inputs
uses: ./.github/actions/prepare-site

# Clone marc_people into the correct location
- name: Clone marc_people repository
uses: actions/checkout@v5
with:
repository: pdnMARC/marc_people
path: src/collection_people
fetch-depth: 1
# If marc_people is private:
# token: ${{ secrets.MARC_PEOPLE_READ_TOKEN }}

# Clone marc_projects into the correct location
- name: Clone marc_projects repository
uses: actions/checkout@v5
with:
repository: pdnMARC/marc_projects
path: src/collection_projects
fetch-depth: 1
# If marc_people is private:
# token: ${{ secrets.MARC_PEOPLE_READ_TOKEN }}

# Clone marc_news into the correct location
- name: Clone marc_news repository
uses: actions/checkout@v5
with:
repository: pdnMARC/marc_news
path: src/collection_news
fetch-depth: 1
# If marc_news is private:
# token: ${{ secrets.MARC_NEWS_READ_TOKEN }}

# -----------------------------
# 🐍 Python Setup using uv
# -----------------------------

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install uv
run: pip install uv

- name: Sync Python dependencies
run: uv sync --frozen

- name: Run Python scripts
run: uv run python_scripts/get_data.py


# Install, build, and upload
- name: Install, build, and upload your site
uses: withastro/action@v5
# with:
# node-version: 22
# package-manager: pnpm@latest

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PR Build Check

on:
pull_request:
branches: [ main ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout main repository
uses: actions/checkout@v5

- name: Prepare site inputs
uses: ./.github/actions/prepare-site

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Install dependencies
run: npm ci

- name: Build site
run: npm run build