Skip to content

Commit 89e0121

Browse files
committed
feat: add CI staging workflow for non-main branches
1 parent 15515bf commit 89e0121

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI - Staging
2+
3+
on:
4+
push:
5+
branches-ignore: [main]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: '20'
15+
- run: corepack enable && corepack prepare pnpm@10.33.0 --activate
16+
- run: pnpm install --no-frozen-lockfile
17+
- run: pnpm build
18+
- run: pnpm test
19+
20+
docker:
21+
needs: build
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: docker/setup-buildx-action@v2
26+
- uses: docker/login-action@v2
27+
with:
28+
username: ${{ secrets.DOCKERHUB_USERNAME }}
29+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
30+
- uses: docker/build-push-action@v4
31+
with:
32+
context: .
33+
push: true
34+
tags: |
35+
chafah/nodejs-app:${{ github.ref_name }}-staging
36+
chafah/nodejs-app:staging

0 commit comments

Comments
 (0)