Skip to content

Commit 10ebb9e

Browse files
author
Sam Morris
committed
update workflows
1 parent da95331 commit 10ebb9e

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
name: Release workflow
1+
name: Deployment workflow
22

33
on:
4-
push:
5-
branches: troubleshoot-eks
6-
#release:
7-
# types: [published]
4+
workflow_call:
5+
inputs:
6+
IMAGE_TAG:
7+
required: true
8+
type: string
89

910
env:
1011
IMAGE_NAME: samanthamorris684/catbot
1112
EKS_CLUSTER_NAME: catbot-cluster
13+
NAMESPACE: cat-chatbot
1214

1315
jobs:
14-
build-push-deploy-image:
15-
name: Build and push image then deploy to EKS
16+
deploy-to-eks:
17+
name: Deploy to EKS
1618
runs-on: ubuntu-latest
1719
steps:
1820
- name: Configure AWS credentials
@@ -27,5 +29,5 @@ jobs:
2729

2830
- name: Deploy to EKS
2931
run: |
30-
kubectl set image deployment/server server=samanthamorris684/catbot:test -n cat-chatbot
32+
kubectl set image deployment/server server=${{ env.IMAGE_NAME }}:${{ inputs.IMAGE_TAG }} -n ${{ env.NAMESPACE }}
3133
kubectl rollout status deployment/server -n cat-chatbot

.github/workflows/main-branch.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ name: Main branch workflow
22

33
on:
44
push:
5-
branches: troubleshoot-eks
6-
#release:
7-
# types: [published]
5+
branches: main
86

97
env:
108
IMAGE_NAME: samanthamorris684/catbot
@@ -13,7 +11,12 @@ jobs:
1311
build-and-push-image:
1412
uses: ./.github/workflows/build-and-push.yml
1513
with:
16-
IMAGE_TAG: test #$GITHUB_SHA
14+
IMAGE_TAG: $GITHUB_SHA
1715
secrets:
1816
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
1922

0 commit comments

Comments
 (0)