name: "ci: Build and Deploy Git Site"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"
push:
branches:
- stable
paths:
- "site/git/**"
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Clone Repo
uses: actions/checkout@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes
accept-flake-config = true
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Build Stagit Site
run: nix run .#build-stagit
- name: Prepare for Deployment
run: mv public site/git/public
- name: Deploy to Cloudflare
id: deploy
uses: cloudflare/wrangler-action@v4
with:
workingDirectory: "site/git"
command: deploy --env production
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Print Deployment URL
run: |
echo "Site deployed to: ${{ steps.deploy.outputs.deployment-url }}"