-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (35 loc) · 1.3 KB
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Publish Docker Images
on:
push:
branches: [master]
pull_request:
branches: [ master ]
release:
types: [published]
jobs:
docker-build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Frontend Docker image
run: docker build frontend --file frontend/Dockerfile --tag tuanicom/incap-frontend:latest
- name: Login to Docker
run: echo $DOCKER_HUB_PASSWORD | docker login --username=tuanicom --password-stdin
if: ${{ github.ref == 'refs/heads/master' }}
- name: Push Frontend Docker image
run: docker push tuanicom/incap-frontend:latest
if: ${{ github.ref == 'refs/heads/master' }}
docker-build-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Backend Docker image
run: docker build backend --file backend/Dockerfile --tag tuanicom/incap-backend:latest
- name: Login to Docker
run: echo $DOCKER_HUB_PASSWORD | docker login --username=tuanicom --password-stdin
if: ${{ github.ref == 'refs/heads/master' }}
- name: Push Backend Docker image
run: docker push tuanicom/incap-backend:latest
if: ${{ github.ref == 'refs/heads/master' }}
env:
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}