-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.29 KB
/
docker_pipe.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
name: CI/CD Pipeline
on:
push:
branches:
- docker_config
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Log in to DockerHub (or another container registry)
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Build and push the frontend image
- name: Build and Push Frontend Image
run: |
FRONT_IMAGE_TAG=$(date +%Y%m%d%H%M)
docker build -t hartypotter/frontend:latest ./Frontend
docker tag hartypotter/frontend:latest hartypotter/frontend:$FRONT_IMAGE_TAG
docker push hartypotter/frontend:latest
docker push hartypotter/frontend:$FRONT_IMAGE_TAG
# Build and push the backend image
- name: Build and Push Backend Image
run: |
BACK_IMAGE_TAG=$(date +%Y%m%d%H%M)
docker build -t hartypotter/backend:latest ./Backend
docker tag hartypotter/backend:latest hartypotter/backend:$BACK_IMAGE_TAG
docker push hartypotter/backend:latest
docker push hartypotter/backend:$BACK_IMAGE_TAG