File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 2
2
name : Publish Image
3
3
4
4
concurrency :
5
- group : ${{ github.head_ref || github.run_id }}
6
- cancel-in-progress : true
5
+ group : ${{ github.head_ref || github.run_id }}
6
+ cancel-in-progress : true
7
7
8
8
on :
9
+ release :
10
+ types : [published]
9
11
workflow_dispatch :
10
12
13
+ env :
14
+ image : ghcr.io/nilashishc/ansible-creator-service
15
+
11
16
jobs :
12
17
build-test :
13
18
runs-on : ubuntu-latest
24
29
password : ${{ secrets.GITHUB_TOKEN }}
25
30
26
31
- name : Build the container image for ansible-creator-service and publish it
32
+ if : github.event_name == 'workflow_dispatch'
33
+ run : |
34
+ docker build -f Containerfile -t ${{ env.image }}:latest .
35
+
36
+ - name : Build the container image for ansible-creator-service and publish it (when tagged)
37
+ if : github.event_name == 'release'
38
+ run : |
39
+ docker build -f Containerfile -t ${{ env.image }}:latest -t ${{ env.image }}:${{ github.ref_name }} .
40
+
41
+ - name : Push image with all tags
27
42
run : |
28
- docker build -f Containerfile -t ghcr.io/nilashishc/ansible-creator-service:latest .
29
- docker push ghcr.io/nilashishc/ansible-creator-service:latest
43
+ docker push ${{ env.image }} --all-tags
You can’t perform that action at this time.
0 commit comments