Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/BuildApp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
pull_request:
types: [opened, synchronize, reopened]


jobs:
Package:
name: Build Test And Push Image
Expand All @@ -18,6 +17,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS Credentials 2
uses: aws-actions/configure-aws-credentials@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
aws-region: us-east-1
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: arn:aws:iam::637423374452:role/Terrafor-iac

- uses: benjlevesque/[email protected]
id: short-sha
with:
Expand Down Expand Up @@ -46,7 +54,6 @@ jobs:
-Dsonar.language=go
-Dsonar.qualitygate.wait=true


- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -81,3 +88,13 @@ jobs:
REGISTRY: ghcr.io
REPOSITORY: ${{ github.repository }}
IMAGE_TAG: ${{ steps.short-sha.outputs.sha }}

- name: Login to AWS
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
shell: bash
run: aws eks update-kubeconfig --region us-east-1 --name development

- uses: actions-hub/kubectl@master
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
args: set image deployment/tech-challenge tech-challenge-container=ghcr.io/${{ github.repository }}:${{ steps.short-sha.outputs.sha }}
Loading