-
Notifications
You must be signed in to change notification settings - Fork 7
68 lines (63 loc) · 2.31 KB
/
workflow-cicd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: workflow-cicd
on:
push:
branches:
- main
- beta
pull_request_target:
types: [assigned, opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
pr:
name: Nx Cloud - PR Job
if: ${{ (github.event_name == 'pull_request') }}
uses: ./.github/workflows/nx-cloud-main.yml
with:
enable-github-app: true
main-branch-name: ${{ github.event.pull_request.base.ref || github.ref_name }}
number-of-agents: 3
parallel-commands: |
pnpm exec nx format:check
parallel-commands-on-agents: |
pnpm exec nx affected --target=lint --parallel=3
pnpm exec nx affected --target=test --parallel=3 --configuration=ci
pnpm exec nx affected --target=build --parallel=3
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
BOT_APP_ID: ${{ secrets.RELEASE_BOT_APP_ID }}
BOT_PRIVATE_KEY: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
release:
name: Nx Cloud - Release Job
if: ${{ (github.event_name != 'pull_request' || github.event.action == 'closed' && github.event.pull_request.merged == true) }}
uses: ./.github/workflows/nx-cloud-main.yml
with:
enable-github-app: true
main-branch-name: ${{ github.ref_name }}
number-of-agents: 3
parallel-commands: |
pnpm exec nx format:check
parallel-commands-on-agents: |
pnpm exec nx affected --target=lint --parallel=3
pnpm exec nx affected --target=test --parallel=3 --configuration=ci
pnpm exec nx affected --target=build --parallel=3
final-commands: |
pnpm exec nx affected --target=semantic-release
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
BOT_APP_ID: ${{ secrets.RELEASE_BOT_APP_ID }}
BOT_PRIVATE_KEY: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
agents:
name: Nx Cloud - Agents
uses: ./.github/workflows/nx-cloud-agents.yml
with:
enable-github-app: true
number-of-agents: 3
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
BOT_APP_ID: ${{ secrets.RELEASE_BOT_APP_ID }}
BOT_PRIVATE_KEY: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}