Skip to content

Commit 221d2e0

Browse files
authored
Merge pull request #2 from podosoft-dev/ci/optimize-pr-checks
ci: optimize PR checks and Docker build workflow
2 parents 4453a91 + ee8ca54 commit 221d2e0

3 files changed

Lines changed: 35 additions & 5 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
- main
77
tags:
88
- 'v*'
9-
pull_request:
10-
branches:
11-
- main
129
workflow_dispatch:
1310

1411
env:
@@ -30,7 +27,6 @@ jobs:
3027
uses: docker/setup-buildx-action@v3
3128

3229
- name: Log in to the Container registry
33-
if: github.event_name != 'pull_request'
3430
uses: docker/login-action@v3
3531
with:
3632
registry: ${{ env.REGISTRY }}
@@ -54,7 +50,7 @@ jobs:
5450
with:
5551
context: .
5652
platforms: linux/amd64,linux/arm64
57-
push: ${{ github.event_name != 'pull_request' }}
53+
push: true
5854
tags: ${{ steps.meta.outputs.tags }}
5955
labels: ${{ steps.meta.outputs.labels }}
6056
cache-from: type=gha

.github/workflows/pr-checks.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types: [opened, synchronize, reopened]
8+
9+
jobs:
10+
lint-and-format:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run ESLint
27+
run: npm run lint
28+
29+
- name: Check formatting with Prettier
30+
run: npm run format:check
31+
32+
- name: Type check
33+
run: npm run check

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"lint": "eslint .",
1515
"lint:fix": "eslint . --fix",
1616
"format": "prettier --write .",
17+
"format:check": "prettier --check .",
1718
"test:server": "node test-server.cjs",
1819
"test:e2e": "playwright test",
1920
"test:e2e:ui": "playwright test --ui",

0 commit comments

Comments
 (0)