Skip to content

Commit 086c541

Browse files
committed
feat: add build and deploy-staging jobs to workflow
1 parent 5f5cc30 commit 086c541

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/deployment.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,55 @@ jobs:
8282

8383
- name: 🔍 Run tests
8484
run: pnpm test
85+
86+
build:
87+
name: 🏗️ Build
88+
runs-on: ubuntu-latest
89+
needs: [lint, typecheck, test]
90+
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' }}
91+
steps:
92+
- name: ⬇️ Checkout code
93+
uses: actions/checkout@v4
94+
95+
- name: ⚙️ Install pnpm
96+
uses: pnpm/action-setup@v4
97+
with:
98+
version: ${{ env.PNPM_VERSION }}
99+
100+
- name: ⚙️ Setup Node.js
101+
uses: actions/setup-node@v4
102+
with:
103+
node-version: ${{ env.NODE_VERSION }}
104+
cache: "pnpm"
105+
106+
- name: 🥁 Install dependencies
107+
run: pnpm install --frozen-lockfile
108+
109+
- name: 🧱 Build application
110+
run: pnpm build
111+
112+
deploy-staging:
113+
name: 🚀 Deploy Staging
114+
runs-on: ubuntu-latest
115+
timeout-minutes: 15
116+
needs: build
117+
if: ${{ github.ref == 'refs/heads/dev' }}
118+
119+
steps:
120+
- name: ⬇️ Checkout code
121+
uses: actions/checkout@v4
122+
123+
- name: ⚙️ Setup Flyctl
124+
uses: superfly/flyctl-actions/setup-flyctl@master
125+
126+
- name: ⚙️ Get app name
127+
uses: SebRollen/toml-action@v1.0.0
128+
id: app_name
129+
with:
130+
file: "fly.toml"
131+
field: "app"
132+
133+
- name: 🚀 Deploy to staging
134+
run: flyctl deploy --remote-only --app ${{ steps.app_name.outputs.values }}_staging
135+
env:
136+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

0 commit comments

Comments
 (0)