Skip to content

Commit 742c6be

Browse files
committed
feat: added workflow
1 parent 9232d37 commit 742c6be

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 '/' '-')

0 commit comments

Comments
 (0)