Skip to content

Commit 9f6d254

Browse files
authored
Update build-docker.yaml
update .next file
1 parent 5d4eb5f commit 9f6d254

1 file changed

Lines changed: 18 additions & 43 deletions

File tree

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,32 @@
11
name: Build and Publish Docker Images
22

33
on:
4-
workflow_dispatch: # Allows manual triggering from GitHub UI
5-
inputs:
6-
api_image_tag:
7-
description: "Tag for the API image"
8-
default: "latest"
9-
required: false
10-
frontend_image_tag:
11-
description: "Tag for the Frontend image"
12-
default: "latest"
13-
required: false
4+
workflow_dispatch:
145

156
jobs:
16-
build_and_push_images:
7+
publish_images:
178
runs-on: ubuntu-latest
18-
199
steps:
20-
# Step 1: Checkout repository
21-
- name: Checkout Repository
10+
# Step 1: Checkout the repository
11+
- name: Checkout repository
2212
uses: actions/checkout@v4
23-
13+
2414
# Step 2: Log in to Docker Hub
2515
- name: Log in to Docker Hub
26-
uses: docker/login-action@v2
27-
with:
28-
username: echelonkay
29-
password: ${{ secrets.DOCKER_HUB_TOKEN }}
16+
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "echelonkay" --password-stdin
3017

31-
# Step 3: Build API Docker Image
32-
- name: Build API Docker Image
33-
run: |
34-
docker build ./api/ \
35-
-t echelonkay/devops-qr-code-api:${{ github.event.inputs.api_image_tag }} \
36-
-t echelonkay/devops-qr-code-api:latest \
37-
--no-cache
18+
# Step 3: Build API Docker image
19+
- name: Build API Docker image
20+
run: docker build ./api/ -t echelonkay/devops-qr-code-api:latest --no-cache
3821

39-
# Step 4: Push API Docker Image
40-
- name: Push API Docker Image
41-
run: |
42-
docker push echelonkay/devops-qr-code-api:${{ github.event.inputs.api_image_tag }}
43-
docker push echelonkay/devops-qr-code-api:latest
22+
# Step 4: Build Frontend Docker image
23+
- name: Build Frontend Docker image
24+
run: docker build ./front-end-nextjs/ -t echelonkay/devops-qr-code-frontend:latest --no-cache
4425

45-
# Step 5: Build Frontend Docker Image
46-
- name: Build Frontend Docker Image
47-
run: |
48-
docker build ./front-end-nextjs/ \
49-
-t echelonkay/devops-qr-code-frontend:${{ github.event.inputs.frontend_image_tag }} \
50-
-t echelonkay/devops-qr-code-frontend:latest \
51-
--no-cache
26+
# Step 5: Push API Docker image to Docker Hub
27+
- name: Push API Docker image
28+
run: docker push echelonkay/devops-qr-code-api:latest
5229

53-
# Step 6: Push Frontend Docker Image
54-
- name: Push Frontend Docker Image
55-
run: |
56-
docker push echelonkay/devops-qr-code-frontend:${{ github.event.inputs.frontend_image_tag }}
57-
docker push echelonkay/devops-qr-code-frontend:latest
30+
# Step 6: Push Frontend Docker image to Docker Hub
31+
- name: Push Frontend Docker image
32+
run: docker push echelonkay/devops-qr-code-frontend:latest

0 commit comments

Comments
 (0)