Skip to content

Commit 03ba234

Browse files
committed
Fix DockerHub secrets in CI
1 parent d4d0e95 commit 03ba234

1 file changed

Lines changed: 32 additions & 26 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,40 @@ on:
44
push:
55
branches: [ main ]
66

7+
env:
8+
REGISTRY: docker.io
9+
IMAGE_NAME_BACKEND: famouswealth/devops-backend
10+
IMAGE_NAME_FRONTEND: famouswealth/devops-frontend
11+
712
jobs:
813
build-and-push:
914
runs-on: ubuntu-latest
1015

1116
steps:
12-
- name: Checkout code
13-
uses: actions/checkout@v3
14-
15-
- name: Set up Docker Buildx
16-
uses: docker/setup-buildx-action@v3
17-
18-
- name: Login to Docker Hub
19-
uses: docker/login-action@v2
20-
with:
21-
username: ${{ secrets.DOCKERHUB_USERNAME }}
22-
password: ${{ secrets.DOCKERHUB_TOKEN }}
23-
24-
25-
- name: Build and push backend
26-
uses: docker/build-push-action@v5
27-
with:
28-
context: ./backend
29-
push: true
30-
tags: famouswealth/devops-e2e-backend:latest
31-
32-
- name: Build and push frontend
33-
uses: docker/build-push-action@v5
34-
with:
35-
context: ./frontend
36-
push: true
37-
tags: famouswealth/devops-e2e-frontend:latest
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Log in to DockerHub
24+
uses: docker/login-action@v3
25+
with:
26+
username: ${{ secrets.DOCKERHUB_USERNAME }}
27+
password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
29+
- name: Build and push backend
30+
uses: docker/build-push-action@v5
31+
with:
32+
context: ./backend
33+
file: ./backend/Dockerfile
34+
push: true
35+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BACKEND }}:latest
36+
37+
- name: Build and push frontend
38+
uses: docker/build-push-action@v5
39+
with:
40+
context: ./frontend
41+
file: ./frontend/Dockerfile
42+
push: true
43+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FRONTEND }}:latest

0 commit comments

Comments
 (0)