Skip to content

Commit

Permalink
feat: Integração Contínua com Amazon ECR e ECS
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacAndra committed Sep 18, 2024
1 parent b59c138 commit 1a7e8d1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}


- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}

- name: Login to Amazon ECR Private
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2


- name: Build Application JAR
Expand All @@ -45,6 +57,15 @@ jobs:
run: docker compose build


- name: Tag and push docker image to Amazon ECR
run: |
docker tag ${{ secrets.DOCKER_USERNAME }}/blog-api-server:latest ${{ secrets.IMAGE_REPO_URL }}:${{ github.run_id }}
docker tag ${{ secrets.DOCKER_USERNAME }}/blog-api-server:latest ${{ secrets.IMAGE_REPO_URL }}:latest
docker push ${{ secrets.IMAGE_REPO_URL }}:${{ github.run_id }}
docker push ${{ secrets.IMAGE_REPO_URL }}:latest
- name: Push to Docker Hub Container Registry
run: |
docker tag ${{ secrets.DOCKER_USERNAME }}/blog-api-server:latest ${{ secrets.DOCKER_USERNAME }}/blog-api-server:${{ github.run_id }}
Expand Down

0 comments on commit 1a7e8d1

Please sign in to comment.