master
1name: Deploy Git to Cloudflare Pages
2on:
3 push:
4 branches: [master]
5 workflow_dispatch:
6concurrency:
7 group: environment-${{ github.ref }}
8 cancel-in-progress: true
9env:
10 PROJECT_NAME: swissknife-git
11 BUILD_DIR: output
12jobs:
13 publish:
14 runs-on: ubuntu-latest
15 permissions:
16 contents: read
17 deployments: write
18 name: Deploy to Cloudflare Pages
19 steps:
20 - name: Checkout
21 uses: actions/checkout@v6
22 with:
23 fetch-depth: 0
24 # ---------- build ----------
25 - name: Setup Go
26 uses: actions/setup-go@v6
27 with:
28 go-version: stable
29 cache: true
30 - name: Install gitmal
31 run: go install github.com/antonmedv/gitmal@latest
32 - name: Build
33 run: gitmal --theme onedark .
34 # ---------- publish ----------
35 - name: Deploy to Cloudflare Pages
36 uses: cloudflare/wrangler-action@v3
37 with:
38 apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
39 accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
40 command: pages deploy ${{ env.BUILD_DIR }} --project-name=${{ env.PROJECT_NAME }}