Skip to content

Commit 3ce4078

Browse files
committed
ci: Running CI checks also on push
1 parent 9186926 commit 3ce4078

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

.github/workflows/main.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ jobs:
1818
with:
1919
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2020

21-
# Job that runs on PR (before merge)
22-
pr-checks:
23-
if: github.event_name == 'pull_request'
21+
# Job that runs for both PR and merge
22+
ci-checks:
2423
runs-on: ubuntu-latest
25-
name: PR Checks
24+
name: CI Checks (Build, Lint, Test, Release Dry-Run)
2625
steps:
2726
- name: Checkout code
2827
uses: actions/checkout@v4
@@ -62,17 +61,31 @@ jobs:
6261
run: npx nx affected --target=test --parallel=3 --coverage
6362
continue-on-error: false
6463

65-
- name: Run Nx release dry-run
64+
- name: Run Nx release dry-run (PR only)
65+
if: github.event_name == 'pull_request'
6666
run: npx nx release --first-release --dry-run --verbose
6767

68-
# Job that runs after merge (on push to master)
69-
post-merge:
70-
if: github.event_name == 'push'
68+
# Job that runs ONLY after merge (on push to master)
69+
release:
70+
if: github.event_name != 'pull_request'
71+
needs: ci-checks
7172
runs-on: ubuntu-latest
72-
name: Post-merge Actions
73+
name: Release
7374
steps:
7475
- name: Checkout code
7576
uses: actions/checkout@v4
77+
with:
78+
fetch-depth: 0
79+
80+
- name: Setup Node.js
81+
uses: actions/setup-node@v4
82+
with:
83+
node-version: '20'
84+
cache: 'yarn'
85+
86+
- name: Install dependencies
87+
run: yarn install --frozen-lockfile
88+
7689
- name: 🚀 Run Nx Release
7790
run: |
7891
npx nx release --first-release --skip-publish --verbose

0 commit comments

Comments
 (0)