Skip to content

Commit

Permalink
fix: deploy to aws instead of dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
guillevalin committed Nov 11, 2024
1 parent 799974f commit fb4086e
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/deploy-getandpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,27 @@ jobs:
run: |
docker buildx create --use
- name: Configure AWS CLI
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set region us-east-1
- name: Build and push Docker image
env:
DOCKER_REPO: guillevalin/app-getandpublish
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_REPO: 296062555964.dkr.ecr.us-east-1.amazonaws.com/app-getandpublish
LAMBDA_IMAGE_TAG: "latest"
run: |
cd devops-challenge/app-getandpublish
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
aws ecr get-login-password --region us-east-1 | docker login -u AWS --password-stdin 296062555964.dkr.ecr.us-east-1.amazonaws.com
docker build -t $DOCKER_REPO:$LAMBDA_IMAGE_TAG .
docker push $DOCKER_REPO:$LAMBDA_IMAGE_TAG
- name: Configure AWS CLI
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set region us-east-1
- name: Deploy to AWS Lambda
env:
LAMBDA_FUNCTION_NAME: "app-getandpublish"
LAMBDA_ROLE: ${{ secrets.LAMBDA_ROLE }}
DOCKER_REPO_URI: "guillevalin/app-getandpublish:latest"
DOCKER_REPO_URI: "296062555964.dkr.ecr.us-east-1.amazonaws.com/app-getandpublish:latest"
run: |
aws lambda create-function \
--function-name $LAMBDA_FUNCTION_NAME \
Expand Down

0 comments on commit fb4086e

Please sign in to comment.