Skip to content

Commit 089ec3c

Browse files
committed
Automating the deployment of User Service and Order Service to IBM Cloud Code Engine
1 parent c486020 commit 089ec3c

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy to IBM Cloud Code Engine
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Install IBM cloud CLI
17+
run: |
18+
curl -fsSL https://clis.cloud.ibm/install/linux | sh
19+
ibmcloud login --apikey ${{secrets.IBM_CLOUD_API_KEY}} au.icr.io
20+
docker push au.icr.io/mycodeengine/user-service:latest
21+
22+
- name: Build & Push Docker Image(User Service)
23+
run: |
24+
docker build -t au.icr.io/mycodeengine/user-service:latest ./user-service
25+
docker push -u iamapikey -p ${{secrets.IBM_CLOUD_API_KEY}} au.icr.io
26+
docker push au.icr.io/mycodeengine/user-service:latest
27+
28+
- name: Deploy User Service to Code Engine
29+
run: |
30+
ibmcloud ce application update --name user-service --image au.icr.io/mycodeengine/user-service:latest
31+
32+
- name: Build & Push Docker Image(order service)
33+
run: |
34+
docker build -t au.icr.io/mycodeengine/order-service:latest ./order-service
35+
docker push au.icr.io/mycodeengine/order-service:latest
36+
37+
- name: Deploy Order Service to Code Engine
38+
run: |
39+
ibmcloud ce application update --name order-service --image au.icr.io/mycodeengine/order-service:latest

0 commit comments

Comments
 (0)