Skip to content

Commit 9cf0b32

Browse files
authored
Merge pull request #8 from cupofpython/troubleshoot-eks
Troubleshoot eks
2 parents 8c0b364 + 10ebb9e commit 9cf0b32

File tree

3 files changed

+34
-14
lines changed

3 files changed

+34
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
name: Release workflow
1+
name: Deployment workflow
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_call:
5+
inputs:
6+
IMAGE_TAG:
7+
required: true
8+
type: string
69

710
env:
811
IMAGE_NAME: samanthamorris684/catbot
912
EKS_CLUSTER_NAME: catbot-cluster
13+
NAMESPACE: cat-chatbot
1014

1115
jobs:
12-
build-push-deploy-image:
13-
name: Build and push image then deploy to EKS
16+
deploy-to-eks:
17+
name: Deploy to EKS
1418
runs-on: ubuntu-latest
1519
steps:
16-
- name: Build and push to Docker Hub
17-
uses: ./.github/workflows/build-and-push.yml
18-
with:
19-
IMAGE_TAG: $GITHUB_SHA
20-
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
21-
2220
- name: Configure AWS credentials
2321
uses: aws-actions/configure-aws-credentials@v1
2422
with:
@@ -31,5 +29,5 @@ jobs:
3129

3230
- name: Deploy to EKS
3331
run: |
34-
kubectl set image deployment/server samanthamorris684/catbot=samanthamorris684/catbot:$GITHUB_SHA
35-
kubectl rollout status deployment/server
32+
kubectl set image deployment/server server=${{ env.IMAGE_NAME }}:${{ inputs.IMAGE_TAG }} -n ${{ env.NAMESPACE }}
33+
kubectl rollout status deployment/server -n cat-chatbot

.github/workflows/feature-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Feature branch workflow
22

33
on:
44
push:
5-
branches-ignore: [main]
5+
branches-ignore: [troubleshoot-eks]
66

77
jobs:
88
build-and-push-feature:

.github/workflows/main-branch.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Main branch workflow
2+
3+
on:
4+
push:
5+
branches: main
6+
7+
env:
8+
IMAGE_NAME: samanthamorris684/catbot
9+
10+
jobs:
11+
build-and-push-image:
12+
uses: ./.github/workflows/build-and-push.yml
13+
with:
14+
IMAGE_TAG: $GITHUB_SHA
15+
secrets:
16+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
17+
18+
deploy-to-eks:
19+
uses: ./.github/workflows/deploy-to-eks.yml
20+
with:
21+
IMAGE_TAG: $GITHUB_SHA
22+

0 commit comments

Comments
 (0)