Skip to content

Commit

Permalink
feat: add eks deployment in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
aseerkt committed Apr 13, 2024
1 parent fc027da commit faf349c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Setup kubectl
uses: azure/setup-kubectl@v4
id: install
with:
version: "v1.29.3"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -36,3 +42,13 @@ jobs:
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
- name: Set kube config
run: aws eks update-kubeconfig --name ${{ secrets.EKS_CLUSTER }} --region ${{ secrets.AWS_REGION }}

- name: Deploy changes to EKS cluster
env:
IMAGE: ${{steps.login-ecr.outputs.registry}}/${{secrets.AWS_ECR_REPOSITORY}}:${{github.sha}}
run: |
kubectl apply -f eks/deployment.yml
kubectl apply -f eks/service.yml
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ COPY --from=builder /app/server .
COPY --from=builder /app/migrate .

COPY app.env .
COPY start.sh .
COPY scripts/start.sh .
COPY sql/migrations/ ./sql/migrations/

CMD ["server"]
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit faf349c

Please sign in to comment.