forked from truemark/hello-world-java
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (57 loc) · 2.01 KB
/
eks-deploy.yml
File metadata and controls
63 lines (57 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
on:
workflow_call:
secrets:
aws_assume_role:
description: "AWS role to assume"
required: false
inputs:
environment:
description: "Environment to deploy to"
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-latest
container: # Replace with GitHub action in the future
image: public.ecr.aws/truemark/aws-cdk:ubuntu
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: image-tag
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
# TODO Convert to secret
role-to-assume: "${{ vars.AWS_ASSUME_ROLE_DEPLOY }}"
aws-region: "us-east-2"
# - name: CDK Deploy
# run: |
# cd cdk
# pnpm i --frozen-lockfile
# cdk -c env=${{ inputs.environment }} deploy --require-approval never
# TODO Get rid of separate role
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: "${{ vars.AWS_ASSUME_ROLE_DEPLOY }}"
aws-region: "us-east-2"
- name: Get Docker Image Tag
shell: bash
run: |
echo "IMAGE_TAG=$(cat image-tag.txt)" >> $GITHUB_ENV
- name: Setup Cluster Access
run: |
aws eks update-kubeconfig --name ${{ vars.CLUSTER_NAME }} --kubeconfig ./kubeconfig
echo 'KUBE_CONFIG_DATA<<EOF' >> $GITHUB_ENV
echo $(cat ./kubeconfig | base64) >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
env:
AWS_REGION: "us-east-2"
- name: Helm Deploy
uses: koslib/helm-eks-action@v1.28.0
env:
KUBE_CONFIG_DATA: ${{ env.KUBE_CONFIG_DATA }}
with:
command: helm upgrade --install -n hello-world --create-namespace --wait --atomic --set image.tag=$IMAGE_TAG -f helm-chart/hello-world/values.yaml hello-world helm-chart/hello-world