File tree Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Original file line number Diff line number Diff line change 1
1
name : build
2
2
3
3
on :
4
- push :
5
- branches : [ main ]
6
4
pull_request :
7
5
branches : [ main ]
8
6
Original file line number Diff line number Diff line change
1
+ name : deploy
2
+
3
+ on :
4
+ push :
5
+ branches : [ main ]
6
+
7
+ jobs :
8
+
9
+ deploy :
10
+ runs-on : ubuntu-latest
11
+ env :
12
+ GITHUB_REPOSITORY : ghcr.io/${{ github.repository }}
13
+ permissions :
14
+ contents : read
15
+ packages : write
16
+ steps :
17
+ - uses : actions/checkout@v2
18
+
19
+ - name : Set up Go
20
+ uses : actions/setup-go@v2
21
+ with :
22
+ go-version : 1.17
23
+
24
+ - name : Build image
25
+ run : make docker-build
26
+
27
+ - name : Login to GitHub Container Registry
28
+ uses : docker/login-action@v1
29
+ with :
30
+ registry : ghcr.io
31
+ username : ${{ github.actor }}
32
+ password : ${{ secrets.GITHUB_TOKEN }}
33
+
34
+ - name : Tag image for github container repository with commit SHA
35
+ run : ' docker tag controller:latest $GITHUB_REPOSITORY:${{env.GITHUB_SHA}}'
36
+
37
+ - name : Push image for github container repository with commit SHA
38
+ run : ' docker push controller:latest $GITHUB_REPOSITORY:${{env.GITHUB_SHA}}'
39
+
40
+ - name : Tag image for github container repository with latest
41
+ run : ' docker tag controller:latest $GITHUB_REPOSITORY:latest'
42
+
43
+ - name : Push image for github container repository with latest
44
+ run : ' docker push controller:latest $GITHUB_REPOSITORY:latest'
You can’t perform that action at this time.
0 commit comments