File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ name: Build and Deploy
2
2
3
3
on :
4
4
push :
5
- branches : [ "master"]
5
+ branches : ["master"]
6
6
# Publish semver tags as releases.
7
7
tags : [ "v*.*.*" ]
8
8
pull_request :
9
- branches : [ "master"]
9
+ branches : ["master"]
10
+ release :
11
+ types : ["created"]
10
12
workflow_dispatch :
11
13
inputs : {}
12
14
62
64
deploy :
63
65
needs : [ "scan" ]
64
66
runs-on : ubuntu-20.04
65
- if : startsWith( github.ref, 'refs/tags/v')
67
+ if : github.event_name == 'release' && github.event.action == 'created'
66
68
steps :
69
+ - name : Login to Docker Hub
70
+ uses : docker/login-action@v2
71
+ with :
72
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
73
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
74
+ - name : Login to GitHub Container Registry
75
+ uses : docker/login-action@v2
76
+ with :
77
+ registry : ghcr.io
78
+ username : ${{ github.actor }}
79
+ password : ${{ secrets.GHCR_TOKEN }}
67
80
- uses : actions/checkout@v2
68
- - run : make push
81
+ with :
82
+ # Need tags for Makefile logic to work
83
+ fetch-depth : 0
84
+ - name : Build and Push Docker Images
85
+ run : make push
You can’t perform that action at this time.
0 commit comments