File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Push to Docker Hub
2
+
3
+ on :
4
+ merge :
5
+ branches :
6
+ - ' *'
7
+ push :
8
+ branches :
9
+ - ' *'
10
+ pull_request :
11
+ types :
12
+ - ' opened'
13
+ - ' synchronize'
14
+
15
+ jobs :
16
+ build-and-push :
17
+ runs-on : ubuntu-latest
18
+
19
+ steps :
20
+ - name : Checkout code
21
+ uses : actions/checkout@v2
22
+
23
+ - name : Dump GitHub context
24
+ env :
25
+ GITHUB_CONTEXT : ${{ toJson(github) }}
26
+ run : echo "$GITHUB_CONTEXT"
27
+
28
+ - name : Login to Docker Hub
29
+ run : echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
30
+
31
+ - name : Build and push Docker image
32
+ run : |
33
+ docker build -t arcvouchers/service:$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-') .
34
+ docker push arcvouchers/service:$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')
You can’t perform that action at this time.
0 commit comments