Skip to content

Commit 8c0b364

Browse files
author
Sam Morris
committed
create a release workflow
1 parent 401a920 commit 8c0b364

File tree

2 files changed

+35
-29
lines changed

2 files changed

+35
-29
lines changed

.github/workflows/main-branch.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release workflow
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
IMAGE_NAME: samanthamorris684/catbot
9+
EKS_CLUSTER_NAME: catbot-cluster
10+
11+
jobs:
12+
build-push-deploy-image:
13+
name: Build and push image then deploy to EKS
14+
runs-on: ubuntu-latest
15+
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+
22+
- name: Configure AWS credentials
23+
uses: aws-actions/configure-aws-credentials@v1
24+
with:
25+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
26+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
27+
aws-region: ${{ secrets.AWS_REGION }}
28+
29+
- name: Update kube config
30+
run: aws eks update-kubeconfig --name ${{ env.EKS_CLUSTER_NAME }} --region ${{ secrets.AWS_REGION }}
31+
32+
- name: Deploy to EKS
33+
run: |
34+
kubectl set image deployment/server samanthamorris684/catbot=samanthamorris684/catbot:$GITHUB_SHA
35+
kubectl rollout status deployment/server

0 commit comments

Comments
 (0)