Skip to content

Commit 0eed08f

Browse files
committed
ci: migrate main deploy from GitHub Pages to Cloudflare Pages
- deploy.yml: replace gh-pages push with wrangler pages deploy - deploy-preview.yml: add --branch=dev flag for consistency - Both main and dev now deploy to Cloudflare Pages - Projects: lessjs (production) and lessjs-dev (preview)
1 parent cc69e6c commit 0eed08f

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

.github/workflows/deploy-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
with:
4141
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
4242
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
43-
command: pages deploy docs/dist --project-name=lessjs-dev
43+
command: pages deploy docs/dist --project-name=lessjs-dev --branch=dev
4444

4545
- name: Print preview URL
4646
run: |

.github/workflows/deploy.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
name: Deploy Docs to GitHub Pages
1+
name: Deploy Docs to Cloudflare Pages
22

33
on:
44
push:
55
branches: [main]
66
workflow_dispatch:
77

8-
permissions:
9-
contents: write
10-
118
concurrency:
12-
group: 'pages'
9+
group: 'production-deploy'
1310
cancel-in-progress: false
1411

1512
jobs:
@@ -20,24 +17,23 @@ jobs:
2017

2118
- uses: denoland/setup-deno@v2
2219
with:
23-
deno-version: 'v2.7.14'
20+
deno-version: '2'
2421

2522
- name: Install dependencies
2623
run: deno install --node-modules-dir
2724

2825
- name: Build docs
2926
run: deno task build:docs
3027

31-
- name: Deploy to gh-pages branch
28+
- name: Deploy to Cloudflare Pages (production)
29+
uses: cloudflare/wrangler-action@v3
30+
with:
31+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
32+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
33+
command: pages deploy docs/dist --project-name=lessjs --branch=main
34+
35+
- name: Print deployment info
3236
run: |
33-
cd docs/dist
34-
# Cache-bust: unique version file so GitHub Pages CDN treats
35-
# each deploy as new content (no stale edge cache)
36-
echo "$(date -u +%Y%m%dT%H%M%S)" > .version
37-
git init
38-
git config user.name "github-actions[bot]"
39-
git config user.email "github-actions[bot]@users.noreply.github.com"
40-
echo "lessjs.com" > CNAME
41-
git add -A
42-
git commit -m "Deploy LessJS docs site — $(date -u +%Y-%m-%dT%H:%M:%SZ)"
43-
git push -f https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:gh-pages
37+
echo "🚀 Production deployed to lessjs.com"
38+
echo "Branch: main"
39+
echo "Commit: ${{ github.sha }}"

0 commit comments

Comments
 (0)