Skip to content

Commit f206597

Browse files
authored
Create cd.yml
1 parent cb393e3 commit f206597

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/cd.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CD Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
needs: docker-build # Ensure CI (tests + docker build) passes first
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v2
20+
21+
- name: Log in to GitHub Container Registry
22+
uses: docker/login-action@v2
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Build & Push Driver Location Service Image
29+
uses: docker/build-push-action@v4
30+
with:
31+
context: .
32+
file: src/driver-location-service/Dockerfile
33+
push: true
34+
tags: |
35+
ghcr.io/${{ github.repository_owner }}/driver-location-service:latest
36+
ghcr.io/${{ github.repository_owner }}/driver-location-service:${{ github.sha }}
37+
38+
- name: Build & Push Dispatch Service Image
39+
uses: docker/build-push-action@v4
40+
with:
41+
context: .
42+
file: src/dispatch-service/Dockerfile
43+
push: true
44+
tags: |
45+
ghcr.io/${{ github.repository_owner }}/dispatch-service:latest
46+
ghcr.io/${{ github.repository_owner }}/dispatch-service:${{ github.sha }}
47+
48+
- name: Deployment Complete
49+
run: echo "🚀 Images successfully pushed to GitHub Container Registry!"

0 commit comments

Comments
 (0)