stagit

static page generator for git
git clone https://github.com/michaelneuper/stagit.git
README | Files | Log | Refs | LICENSE

stagit/.github/workflows/mirror.yml (1600B)


name: mirror

on:
  push:
    branches: [main]
  schedule:
    - cron: "23 */6 * * *"
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: deploy
  cancel-in-progress: false

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - name: Install libgit2, md4c and pandoc
        run: |
          sudo apt-get update
          sudo apt-get install -y --no-install-recommends libgit2-dev libmd4c-dev libmd4c-html0-dev pandoc

      # Not packaged for Ubuntu; the checksum is from the release's
      # chroma-2.27.0-checksums.txt.
      - name: Install chroma
        run: |
          curl -fsSLO https://github.com/alecthomas/chroma/releases/download/v2.27.0/chroma-2.27.0-linux-amd64.tar.gz
          echo "91e1cd175006ff8a19cdd45ad12f9dd8c4eeeca4ec85703ebcc09cd31122f802  chroma-2.27.0-linux-amd64.tar.gz" | sha256sum -c -
          sudo tar xzf chroma-2.27.0-linux-amd64.tar.gz -C /usr/local/bin chroma

      - name: Build stagit
        run: make

      - name: Generate site
        run: ./build.sh
        env:
          GH_TOKEN: ${{ github.token }}
          GITHUB_USER: ${{ github.repository_owner }}
          SITE_URL: https://git.michaelneuper.com/

      # netlify-cli needs Node 22.13 or newer.
      - uses: actions/setup-node@v7
        with:
          node-version: "22"

      - name: Deploy to Netlify
        run: npx --yes netlify-cli@27.12.0 deploy --prod --no-build --dir public
        env:
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}