File tree Expand file tree Collapse file tree 2 files changed +26
-28
lines changed Expand file tree Collapse file tree 2 files changed +26
-28
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: Deploy
2
2
3
3
on :
4
4
workflow_run :
5
- workflows : ["Build "]
5
+ workflows : ["Publish Docker image "]
6
6
types :
7
7
- completed
8
8
Original file line number Diff line number Diff line change 1
- name : Build
1
+ name : Publish Docker image
2
2
3
3
on :
4
- push :
5
- branches : [ main ]
6
- pull_request :
7
- branches : [ main ]
4
+ release :
5
+ types : [published]
6
+ permissions :
7
+ contents : read
8
+ packages : write
8
9
9
10
jobs :
10
-
11
- build :
12
-
13
- runs-on : self-hosted
14
-
11
+ push_to_registry :
12
+ name : Push Docker image to Docker Hub
13
+ runs-on : ubuntu-latest
15
14
steps :
16
- - name : Login to GitHub Container Registry
17
- uses : docker/login-action@v1
18
- with :
19
- registry : ghcr.io
20
- username : ${{github.actor}}
21
- password : ${{secrets.GITHUB_TOKEN}}
22
-
23
- - name : Checkout
24
- uses : actions/checkout@v2
25
-
26
- - name : Build and push backend Docker image
27
- uses : docker/build-push-action@v2
28
- with :
29
- context : .
30
- push : true
31
- tags : ghcr.io/testausserveri/koirameili
15
+ - name : Check out the repo
16
+ uses : actions/checkout@v2
17
+
18
+ - name : Login to GitHub Container Registry
19
+ uses : docker/login-action@v1
20
+ with :
21
+ registry : ghcr.io
22
+ username : ${{ github.actor }}
23
+ password : ${{ secrets.GITHUB_TOKEN }}
32
24
33
-
25
+ - name : Build and push
26
+ uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
27
+ with :
28
+ context : .
29
+ push : true
30
+ tags : ghcr.io/testausserveri/koirameili:latest,ghcr.io/testausserveri/koirameili:${{ github.event.release.tag_name }}
31
+
You can’t perform that action at this time.
0 commit comments