Skip to content

Commit fc2f098

Browse files
authored
Merge pull request #1156 from credebl/hotfix/push-docker-image
hotfix/push-docker-image
2 parents 5f88f77 + 05e05ab commit fc2f098

18 files changed

+353
-69
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Continuous Delivery
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
11+
jobs:
12+
build-and-push:
13+
name: Push Docker image to GitHub
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
service:
19+
- agent-provisioning
20+
- agent-service
21+
- api-gateway
22+
- cloud-wallet
23+
- connection
24+
- geolocation
25+
- issuance
26+
- ledger
27+
- notification
28+
- user
29+
- utility
30+
- verification
31+
- webhook
32+
33+
permissions:
34+
contents: read
35+
packages: write
36+
37+
steps:
38+
- name: Checkout Repository
39+
uses: actions/checkout@v4
40+
41+
- name: Extract Git Tag
42+
id: get_tag
43+
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
44+
45+
- name: Log in to GitHub Container Registry
46+
uses: docker/login-action@v3
47+
with:
48+
registry: ghcr.io
49+
username: ${{ github.actor }}
50+
password: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Build and Push Docker Image ${{ matrix.service }}
53+
uses: docker/build-push-action@v6
54+
with:
55+
context: .
56+
file: Dockerfiles/Dockerfile.${{ matrix.service }}
57+
push: true
58+
tags: |
59+
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.service }}:${{ env.TAG }}
60+
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.service }}:latest

Dockerfiles/Dockerfile.agent-provisioning

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ COPY . .
2929

3030
# Generate Prisma client
3131
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
32-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
32+
RUN cd libs/prisma-service && npx prisma generate
3333
RUN ls -R /app/apps/agent-provisioning/AFJ/
3434

3535
# Build the user service
@@ -68,6 +68,7 @@ COPY --from=build /app/apps/agent-provisioning/AFJ/port-file ./agent-provisionin
6868
RUN chmod +x /app/agent-provisioning/AFJ/scripts/start_agent.sh
6969
RUN chmod +x /app/agent-provisioning/AFJ/scripts/start_agent_ecs.sh
7070
RUN chmod +x /app/agent-provisioning/AFJ/scripts/docker_start_agent.sh
71+
RUN chmod +x /app/agent-provisioning/AFJ/scripts/fargate.sh
7172
RUN chmod 777 /app/agent-provisioning/AFJ/endpoints
7273
RUN chmod 777 /app/agent-provisioning/AFJ/agent-config
7374
RUN chmod 777 /app/agent-provisioning/AFJ/token
@@ -76,4 +77,4 @@ RUN chmod 777 /app/agent-provisioning/AFJ/token
7677
COPY libs/ ./libs/
7778

7879
# Set the command to run the microservice
79-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/agent-provisioning/main.js"]
80+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/agent-provisioning/main.js"]

Dockerfiles/Dockerfile.agent-service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN pnpm i --ignore-scripts
2424
# Copy the rest of the application code
2525
COPY . .
2626
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
27-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
27+
RUN cd libs/prisma-service && npx prisma generate
2828

2929
# Build the user service
3030
RUN pnpm run build agent-service
@@ -53,4 +53,4 @@ COPY --from=build /app/libs/ ./libs/
5353
COPY --from=build /app/node_modules ./node_modules
5454

5555
# Set the command to run the microservice
56-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/agent-service/main.js"]
56+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/agent-service/main.js"]

Dockerfiles/Dockerfile.api-gateway

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pnpm i --ignore-scripts
1818
# Copy the rest of the application code
1919
COPY . .
2020
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21+
RUN cd libs/prisma-service && npx prisma generate
2222

2323
# Build the api-gateway service
2424
RUN pnpm run build api-gateway
@@ -40,4 +40,4 @@ COPY --from=build /app/node_modules ./node_modules
4040
# COPY --from=build /app/uploadedFiles ./uploadedFiles
4141

4242
# Set the command to run the microservice
43-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/api-gateway/main.js"]
43+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/api-gateway/main.js"]

Dockerfiles/Dockerfile.cloud-wallet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN pnpm i --ignore-scripts
1919
# Copy the rest of the application code
2020
COPY . .
2121
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
22-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
22+
RUN cd libs/prisma-service && npx prisma generate
2323

2424
# Build the user service
2525
RUN pnpm run build cloud-wallet
@@ -43,4 +43,4 @@ COPY --from=build /app/node_modules ./node_modules
4343

4444

4545
# Set the command to run the microservice
46-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/cloud-wallet/main.js"]
46+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/cloud-wallet/main.js"]

Dockerfiles/Dockerfile.connection

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pnpm i --ignore-scripts
1818
# Copy the rest of the application code
1919
COPY . .
2020
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21+
RUN cd libs/prisma-service && npx prisma generate
2222

2323
# Build the connection service
2424
RUN pnpm run build connection
@@ -43,4 +43,4 @@ COPY --from=build /app/node_modules ./node_modules
4343
#RUN npm i --only=production
4444

4545
# Set the command to run the microservice
46-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/connection/main.js"]
46+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/connection/main.js"]

Dockerfiles/Dockerfile.geolocation

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pnpm i --ignore-scripts
1818
# Copy the rest of the application code
1919
COPY . .
2020
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21+
RUN cd libs/prisma-service && npx prisma generate
2222

2323
# Build the connection service
2424
RUN pnpm run build geo-location
@@ -43,4 +43,4 @@ COPY --from=build /app/node_modules ./node_modules
4343
#RUN npm i --only=production
4444

4545
# Set the command to run the microservice
46-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/geo-location/main.js"]
46+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/geo-location/main.js"]

Dockerfiles/Dockerfile.issuance

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pnpm i --ignore-scripts
1818
# Copy the rest of the application code
1919
COPY . .
2020
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21+
RUN cd libs/prisma-service && npx prisma generate
2222

2323
# Build the issuance service
2424
RUN pnpm run build issuance
@@ -42,4 +42,4 @@ COPY --from=build /app/node_modules ./node_modules
4242

4343

4444
# Set the command to run the microservice
45-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/issuance/main.js"]
45+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/issuance/main.js"]

Dockerfiles/Dockerfile.ledger

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pnpm i --ignore-scripts
1818
# Copy the rest of the application code
1919
COPY . .
2020
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
21+
RUN cd libs/prisma-service && npx prisma generate
2222

2323
# Build the ledger service
2424
RUN npm run build ledger
@@ -41,4 +41,4 @@ COPY --from=build /app/libs/ ./libs/
4141
COPY --from=build /app/node_modules ./node_modules
4242

4343
# Set the command to run the microservice
44-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/ledger/main.js"]
44+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/ledger/main.js"]

Dockerfiles/Dockerfile.notification

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN pnpm i --ignore-scripts
1616
# Copy the rest of the application code
1717
COPY . .
1818
# RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
19-
RUN cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate
19+
RUN cd libs/prisma-service && npx prisma generate
2020

2121
# Build the notification service
2222
RUN npm run build notification
@@ -39,4 +39,4 @@ COPY --from=build /app/libs/ ./libs/
3939
COPY --from=build /app/node_modules ./node_modules
4040

4141
# Set the command to run the microservice
42-
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && cd ../.. && node dist/apps/notification/main.js"]
42+
CMD ["sh", "-c", "cd libs/prisma-service && npx prisma migrate deploy && npx prisma generate && cd ../.. && node dist/apps/notification/main.js"]

0 commit comments

Comments
 (0)