Skip to content

Commit 482a671

Browse files
committed
deploy: setup ci-cd
1 parent 235bec5 commit 482a671

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/deploy.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Astro CI/CD with Playwright & Cloudflare Pages
2+
3+
on:
4+
push:
5+
branches: [main] # ou "master" selon ton projet
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
env:
14+
NODE_VERSION: 20
15+
16+
steps:
17+
- name: ⬇️ Checkout repository
18+
uses: actions/checkout@v3
19+
20+
- name: 🟢 Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ env.NODE_VERSION }}
24+
cache: 'pnpm'
25+
26+
- name: 📦 Install dependencies
27+
run: |
28+
corepack enable
29+
pnpm install
30+
31+
- name: 🎭 Install Playwright browsers
32+
run: pnpm exec playwright install --with-deps
33+
34+
- name: 🛠️ Build Astro
35+
run: pnpm run build
36+
37+
- name: 🚀 Deploy to Cloudflare Pages
38+
uses: cloudflare/pages-action@v1
39+
with:
40+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
41+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
42+
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
43+
directory: ./dist
44+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)