Skip to content

Commit 2753a28

Browse files
committed
ci: Update ci workflow
1 parent 38e3253 commit 2753a28

File tree

3 files changed

+43
-43
lines changed

3 files changed

+43
-43
lines changed

.github/workflows/deploy.yml renamed to .github/workflows/build-and-deploy.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: Deploy
2-
run-name: Deploy
1+
name: Build & Deploy
2+
run-name: Build & Deploy
33

44
on:
55
workflow_call:
@@ -10,7 +10,43 @@ on:
1010
type: string
1111

1212
jobs:
13+
build:
14+
name: Run Build Process
15+
runs-on: ubuntu-latest
16+
environment: ${{ inputs.target_env }}
17+
18+
steps:
19+
- name: Checkout code
20+
# Checks out the repository code.
21+
uses: actions/checkout@v4
22+
23+
- name: Load env file
24+
run: echo "${{ secrets.APPLICATION_ENV_FILE }}" > .env
25+
26+
- name: Setup Node.js ${{ inputs.node-version }}
27+
# Sets up NodeJS environment
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ inputs.node-version }}
31+
32+
- name: Install Dependencies
33+
# Install dependencies
34+
run: npm ci
35+
36+
- name: Build Project
37+
# Builds project
38+
run: npm run build --if-present
39+
40+
- name: Upload build artifact (build)
41+
# Uploads build output
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: ${{ vars.PROJECT_NAME }}
45+
path: build
46+
retention-days: 1
47+
1348
deploy:
49+
needs: build
1450
name: Deploy
1551
runs-on: ubuntu-latest
1652
environment: ${{ inputs.target_env }}

.github/workflows/ci-cd-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ on:
3737
jobs:
3838
trigger-full-ci:
3939
name: CI
40-
uses: ./.github/workflows/lint-and-build.yml
40+
uses: ./.github/workflows/lint.yml
4141
secrets: inherit
4242
with:
4343
target_env: ${{ github.ref == 'refs/heads/master' && 'production' || github.ref == 'refs/heads/development' && 'development' || 'invalid' }}
Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: Lint & Build
2-
run-name: Lint & Build
1+
name: Lint
2+
run-name: Lint
33

44
permissions:
55
contents: read
@@ -46,47 +46,11 @@ jobs:
4646
# Runs lint checks
4747
run: npm run lint
4848

49-
build:
50-
needs: lint
51-
name: Run Build Process
52-
runs-on: ubuntu-latest
53-
environment: ${{ inputs.target_env }}
54-
55-
steps:
56-
- name: Checkout code
57-
# Checks out the repository code.
58-
uses: actions/checkout@v4
59-
60-
- name: Load env file
61-
run: echo "${{ secrets.APPLICATION_ENV_FILE }}" > .env
62-
63-
- name: Setup Node.js ${{ inputs.node-version }}
64-
# Sets up NodeJS environment
65-
uses: actions/setup-node@v4
66-
with:
67-
node-version: ${{ inputs.node-version }}
68-
69-
- name: Install Dependencies
70-
# Install dependencies
71-
run: npm ci
72-
73-
- name: Build Project
74-
# Builds project
75-
run: npm run build --if-present
76-
77-
- name: Upload build artifact (build)
78-
# Uploads build output
79-
uses: actions/upload-artifact@v4
80-
with:
81-
name: ${{ vars.PROJECT_NAME }}
82-
path: build
83-
retention-days: 1
84-
8549
trigger-deploy:
86-
needs: build
50+
needs: lint
8751
name: Deploy
8852
if: ${{ inputs.skip_deploy == false }}
89-
uses: ./.github/workflows/deploy.yml
53+
uses: ./.github/workflows/build-and-deploy.yml
9054
secrets: inherit
9155
with:
9256
target_env: ${{ inputs.target_env }}

0 commit comments

Comments
 (0)