dotfiles

My PC Dotfiles & Website

.github/workflows/website-git.yaml (1506B)


 1name: "ci: Build and Deploy Git Site"
 2on:
 3  workflow_dispatch:
 4  schedule:
 5    - cron: "0 0 * * 0"
 6  push:
 7    branches:
 8      - stable
 9    paths:
10      - "site/**"
11      - "flake.lock"
12  pull_request:
13    paths:
14      - "site/**"
15      - "flake.lock"
16jobs:
17  deploy:
18    runs-on: ubuntu-latest
19    permissions:
20      contents: read
21      deployments: write
22    steps:
23      - name: Clone Repo
24        uses: actions/checkout@v7
25        with:
26          token: ${{ secrets.GITHUB_TOKEN }}
27          fetch-depth: 0
28      - name: Install Nix
29        uses: cachix/install-nix-action@v31
30        with:
31          extra_nix_config: |
32            experimental-features = nix-command flakes
33            accept-flake-config = true
34            access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
35      - name: Build Git Site
36        run: nix run .#gitsite
37      - name: Prepare for Deployment
38        run: mv public site/git/public
39      - name: Deploy to Cloudflare
40        if: github.event_name != 'pull_request'
41        id: deploy
42        uses: cloudflare/wrangler-action@v4
43        with:
44          workingDirectory: "site/git"
45          command: deploy --env production
46          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
47          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
48          gitHubToken: ${{ secrets.GITHUB_TOKEN }}
49      - name: Print Deployment URL
50        if: github.event_name != 'pull_request'
51        run: |
52          echo "Site deployed to: ${{ steps.deploy.outputs.deployment-url }}"