File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Build Docker Image
1+ name : Build Application
22
33on :
4- push :
5- branches : [ main ]
6- pull_request :
7- branches : [ main ]
4+ - push
85
96jobs :
10- image- build :
7+ build :
118 runs-on : ubuntu-latest
129
1310 steps :
2522 - name : Generate code
2623 run : make gen
2724
28- - name : Build Docker image
29- run : make image- build
25+ - name : Build application
26+ run : make build
Original file line number Diff line number Diff line change 1- name : Build Application
1+ name : Build image
22
33on :
4- push :
5- branches : [ main ]
6- pull_request :
7- branches : [ main ]
4+ - push
85
96jobs :
107 build :
118 runs-on : ubuntu-latest
12-
139 steps :
14- - name : Checkout code
15- uses : actions/checkout@v4
16-
17- - name : Setup Node.js
18- uses : actions/setup-node@v4
19- with :
20- node-version : ' 20'
10+ - uses : actions/checkout@v6
11+
12+ - name : Set up Docker runtime
13+ uses : docker/setup-buildx-action@v3
14+
15+ - name : Setup Node.js
16+ uses : actions/setup-node@v4
17+ with :
18+ node-version : ' 20'
19+
20+ - name : Install dependencies
21+ run : yarn install
22+
23+ - name : Generate code
24+ run : make gen
2125
22- - name : Install dependencies
23- run : yarn install
24-
25- - name : Generate code
26- run : make gen
27-
28- - name : Build application
29- run : make build
26+ - name : Build image
27+ uses : docker/build-push-action@v6
28+ with :
29+ context : .
30+ push : false
Original file line number Diff line number Diff line change 1+ name : Release image
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ release :
8+ runs-on : ubuntu-latest
9+ permissions :
10+ contents : read
11+ packages : write
12+ steps :
13+ - uses : actions/checkout@v6
14+
15+ - name : Set up Docker runtime
16+ uses : docker/setup-buildx-action@v3
17+
18+ - name : Setup Node.js
19+ uses : actions/setup-node@v4
20+ with :
21+ node-version : ' 20'
22+
23+ - name : Install dependencies
24+ run : yarn install
25+
26+ - name : Generate code
27+ run : make gen
28+
29+ - name : Log in to GitHub Container Registry
30+ uses : docker/login-action@v3
31+ with :
32+ registry : ghcr.io
33+ username : ${{ github.actor }}
34+ password : ${{ secrets.GITHUB_TOKEN }}
35+
36+ - name : Set image name
37+ run : echo "IMAGE_NAME=ghcr.io/hyperleda/hyperleda-webapp" >> $GITHUB_ENV
38+
39+ - name : Set short SHA
40+ run : echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
41+
42+ - name : Build and push image
43+ uses : docker/build-push-action@v6
44+ with :
45+ context : .
46+ push : true
47+ tags : |
48+ ${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }}
49+ ${{ env.IMAGE_NAME }}:latest
Original file line number Diff line number Diff line change 1- name : Format and lint
1+ name : Static checks & tests
22
33on :
4- push :
5- branches : [ main ]
6- pull_request :
7- branches : [ main ]
4+ - push
85
96jobs :
107 lint :
You can’t perform that action at this time.
0 commit comments