-
Notifications
You must be signed in to change notification settings - Fork 42
57 lines (48 loc) · 1.78 KB
/
docker.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build and Push Images to DockerHub
on:
push:
tags:
- '*'
jobs:
build_and_push:
name: Build and Push Images to DockerHub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_NAME }}
password: ${{ secrets.DOCKER_PASSWD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Get tag name
if: startsWith(github.ref, 'refs/tags/')
run: echo "TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')" >> $GITHUB_ENV
- name: Build and Push flask Images
uses: docker/build-push-action@v4
with:
context: '3. Mid-term/Lequanganh/flask'
push: true
file: '3. Mid-term/Lequanganh/flask/Dockerfile'
tags: |
${{ secrets.DOCKER_NAME }}/lqa-flask-app:${{ env.TAG }}
${{ secrets.DOCKER_NAME }}/lqa-flask-app:latest
- name: Build and Push nginx front-end
uses: docker/build-push-action@v4
with:
context: '3. Mid-term/Lequanganh/nginx'
file: '3. Mid-term/Lequanganh/nginx/Dockerfile'
push: true
tags: |
${{ secrets.DOCKER_NAME }}/lqa-web:${{ env.TAG }}
${{ secrets.DOCKER_NAME }}/lqa-web:latest
- name: Build and Push nginx load-balancer
uses: docker/build-push-action@v4
with:
context: '3. Mid-term/Lequanganh/load-balancer'
file: '3. Mid-term/Lequanganh/load-balancer/Dockerfile'
push: true
tags: |
${{ secrets.DOCKER_NAME }}/lqa-load-balancer:${{ env.TAG }}
${{ secrets.DOCKER_NAME }}/lqa-load-balancer:latest