Skip to content

Commit c7b3d2c

Browse files
committed
Split CI: tests on push, Docker build on tags only
- ci.yml: run build + tests on every push and PR to main - docker.yml: build and push Docker image only on v* tags + manual dispatch
1 parent 5f466bf commit c7b3d2c

2 files changed

Lines changed: 30 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 24
19+
cache: npm
20+
21+
- run: npm ci
22+
23+
- name: Build server
24+
run: npm run build:server
25+
26+
- name: Run tests
27+
run: npm test

.github/workflows/docker.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Build and Push Docker Image
22

33
on:
44
push:
5-
branches: [main]
65
tags: ['v*']
6+
workflow_dispatch:
77

88
env:
99
REGISTRY: ghcr.io
@@ -32,10 +32,11 @@ jobs:
3232
with:
3333
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3434
tags: |
35-
type=raw,value=latest,enable={{is_default_branch}}
35+
type=raw,value=latest
3636
type=sha,prefix=
3737
type=semver,pattern={{version}}
3838
type=semver,pattern={{major}}.{{minor}}
39+
type=semver,pattern={{major}}
3940
4041
- name: Build and push
4142
uses: docker/build-push-action@v6

0 commit comments

Comments
 (0)