Skip to content

Build and Deploy to GitHub Pages #45

Build and Deploy to GitHub Pages

Build and Deploy to GitHub Pages #45

Workflow file for this run

name: Build and Deploy to GitHub Pages
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync
- name: Generate files
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
uv run python main.py
mkdir dist
mv index.html dist
mv events.json dist
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages
keep_files: false
force_orphan: true