Skip to content

Commit 0abc83c

Browse files
committed
ci: setup deploy workflow
1 parent 391f3bb commit 0abc83c

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/deploy.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: "Deploy Blog"
2+
3+
concurrency:
4+
group: deploy-blog-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
workflow_dispatch:
9+
push:
10+
branches:
11+
- main
12+
tags:
13+
- "v*.*.*"
14+
paths:
15+
- "__posts/**"
16+
- "__books/**"
17+
18+
permissions:
19+
contents: read
20+
deployments: write
21+
id-token: write
22+
23+
defaults:
24+
run:
25+
shell: bash
26+
27+
jobs:
28+
deploy:
29+
runs-on: ubuntu-latest
30+
environment: production
31+
32+
steps:
33+
- name: 🛡️ Harden the runner
34+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
35+
with:
36+
egress-policy: audit
37+
38+
- name: 📦 Checkout code
39+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
40+
with:
41+
fetch-depth: 1
42+
43+
- name: 🇳 Setup Node.js
44+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
45+
with:
46+
node-version: "22.20.0"
47+
cache: "npm"
48+
cache-dependency-path: package-lock.json
49+
50+
- name: ⚒️ Setup just
51+
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
52+
with:
53+
just-version: "1.40.0"
54+
55+
- name: ⚙️ Install dependencies
56+
run: just ci
57+
58+
- name: 🏗️ Build production output
59+
run: just build
60+
61+
- name: 🚀 Deploy to Cloudflare Pages
62+
id: deploy
63+
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3
64+
with:
65+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
66+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
67+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
68+
command: pages deploy dist/blog --project-name=blog --branch=main --commit-hash=${{ github.sha }} --commit-dirty=true

0 commit comments

Comments
 (0)