Skip to content

Commit f0de58e

Browse files
committed
(feat) - Add wrangler and github action for deployment
1 parent 11d840c commit f0de58e

File tree

5 files changed

+1587
-27
lines changed

5 files changed

+1587
-27
lines changed

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
environment: Production
11+
permissions:
12+
contents: read
13+
deployments: write
14+
env:
15+
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
16+
steps:
17+
- name: Create deployment status
18+
uses: bobheadxi/deployments@v1
19+
id: deployment
20+
with:
21+
step: start
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
env: Production
24+
env_url: ${{ vars.BASE_URL }}
25+
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
# Setup cache for dependencies after account upgrade
30+
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version-file: '.nvmrc'
35+
36+
- name: Install dependencies
37+
run: npm install
38+
39+
- name: Deploy to Cloudflare Workers
40+
uses: cloudflare/wrangler-action@v3
41+
with:
42+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
43+
command: |
44+
deploy
45+
46+
- name: Update deployment status
47+
uses: bobheadxi/deployments@v1
48+
if: always()
49+
with:
50+
step: finish
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
status: ${{ job.status }}
53+
env: ${{ steps.deployment.outputs.env }}
54+
env_url: ${{ vars.BASE_URL }}
55+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}

.gitignore

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,44 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
110
node_modules
211
dist
12+
dist-ssr
13+
*.local
314
.tmp
4-
bower_components
5-
test
6-
text/
7-
.editorconfig
8-
.yo-rc.json
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?
26+
.env
27+
*.tsbuildinfo
28+
29+
.history/
30+
.env
31+
32+
# Cloudflare workers
33+
.wrangler
34+
.dev.vars*
35+
36+
# App
937
app/temp/
1038
app/fonts/
1139
app/vendor/autoload.php
1240
app/styles/.sass-cache
13-
.DS_Store
41+
1442
app/vendor/mpdf
1543
app/vendor/setasign
1644
app/vendor/composer
17-
npm-debug.log
18-
.history/
19-
.env

0 commit comments

Comments
 (0)