File tree Expand file tree Collapse file tree 3 files changed +43
-43
lines changed Expand file tree Collapse file tree 3 files changed +43
-43
lines changed Original file line number Diff line number Diff line change 1
- name : Deploy
2
- run-name : Deploy
1
+ name : Build & Deploy
2
+ run-name : Build & Deploy
3
3
4
4
on :
5
5
workflow_call :
10
10
type : string
11
11
12
12
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
+
13
48
deploy :
49
+ needs : build
14
50
name : Deploy
15
51
runs-on : ubuntu-latest
16
52
environment : ${{ inputs.target_env }}
Original file line number Diff line number Diff line change 37
37
jobs :
38
38
trigger-full-ci :
39
39
name : CI
40
- uses : ./.github/workflows/lint-and-build .yml
40
+ uses : ./.github/workflows/lint.yml
41
41
secrets : inherit
42
42
with :
43
43
target_env : ${{ github.ref == 'refs/heads/master' && 'production' || github.ref == 'refs/heads/development' && 'development' || 'invalid' }}
Original file line number Diff line number Diff line change 1
- name : Lint & Build
2
- run-name : Lint & Build
1
+ name : Lint
2
+ run-name : Lint
3
3
4
4
permissions :
5
5
contents : read
@@ -46,47 +46,11 @@ jobs:
46
46
# Runs lint checks
47
47
run : npm run lint
48
48
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
-
85
49
trigger-deploy :
86
- needs : build
50
+ needs : lint
87
51
name : Deploy
88
52
if : ${{ inputs.skip_deploy == false }}
89
- uses : ./.github/workflows/deploy.yml
53
+ uses : ./.github/workflows/build-and- deploy.yml
90
54
secrets : inherit
91
55
with :
92
56
target_env : ${{ inputs.target_env }}
You can’t perform that action at this time.
0 commit comments