Skip to content

Commit 3ac8855

Browse files
authored
Merge pull request #1 from sprintertech/feat/ci-cd-workflows
feat: add CI/CD workflows for Cloudflare Pages deployment
2 parents 2212f2f + e245df7 commit 3ac8855

3 files changed

Lines changed: 123 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: ci
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 20
15+
cache: npm
16+
17+
- name: Install deps
18+
run: npm ci
19+
20+
- name: Build
21+
run: npm run build
22+
23+
- name: Upload Artifact
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: dist
27+
path: ./dist
28+
29+
deploy:
30+
needs: build
31+
runs-on: ubuntu-latest
32+
environment:
33+
name: miso-landing-web
34+
url: ${{ steps.deploy-step.outputs.deployment-url }}
35+
outputs:
36+
deployment-url: ${{ steps.deploy-step.outputs.deployment-url }}
37+
steps:
38+
- name: Download Artifact
39+
uses: actions/download-artifact@v4
40+
with:
41+
name: dist
42+
path: ./dist
43+
44+
- name: Deploy preview to Cloudflare Pages
45+
id: deploy-step
46+
uses: cloudflare/wrangler-action@v3
47+
with:
48+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
49+
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
50+
command: pages deploy ./dist --project-name=miso-landing-web --branch=${{ github.head_ref }}

.github/workflows/manual.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy to Production
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 20
15+
cache: npm
16+
17+
- name: Install deps
18+
run: npm ci
19+
20+
- name: Build
21+
run: npm run build
22+
23+
- name: Upload Artifact
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: dist
27+
path: ./dist
28+
29+
deploy:
30+
needs: build
31+
runs-on: ubuntu-latest
32+
environment:
33+
name: miso-landing-web
34+
url: ${{ steps.deploy-step.outputs.deployment-url }}
35+
outputs:
36+
deployment-url: ${{ steps.deploy-step.outputs.deployment-url }}
37+
steps:
38+
- name: Download Artifact
39+
uses: actions/download-artifact@v4
40+
with:
41+
name: dist
42+
path: ./dist
43+
44+
- name: Deploy to Cloudflare Pages
45+
id: deploy-step
46+
uses: cloudflare/wrangler-action@v3
47+
with:
48+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
49+
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
50+
command: pages deploy ./dist --project-name=miso-landing-web

.github/workflows/pr.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Semantic PR"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v4
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
types: |
20+
fix
21+
feat
22+
chore
23+
revert

0 commit comments

Comments
 (0)