Created
December 7, 2022 22:03
-
-
Save emrekasg/43ab1d979045380330d14cc2d446d348 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Build image | |
runs-on: ubuntu-latest | |
env: | |
GOPRIVATE: github.com/testgenielabs/go-service-helpers | |
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
env: | |
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-region: us-east-1 | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Build, tag, and push image to Amazon ECR | |
run: | | |
git config --global url.https://[email protected]/.insteadOf https://github.com/ | |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/j6y0q1o5 | |
docker build -t common-projects . | |
docker tag common-projects:latest public.ecr.aws/j6y0q1o5/common-projects:${{ github.sha }} | |
docker push public.ecr.aws/j6y0q1o5/common-projects:${{ github.sha }} | |
- name: Deploy to AWS EKS | |
uses: ianbelcher/eks-kubectl-action@master | |
with: | |
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws_region: eu-west-1 | |
cluster_name: testgenie | |
args: set image deployment/commonprojects commonprojects-service=public.ecr.aws/j6y0q1o5/common-projects:${{ github.sha }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment