In repo .github/workflows/deploy.yml:
name: Deploy to ECSon: [push]jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Configure AWS 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: us-west-2 - name: Login to ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v2 - name: Build, tag, push env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: my-app-repo IMAGE_TAG: latest run: | docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - name: Update ECS run: | aws ecs update-service --cluster my-cluster --service my-service --force-new-deploymentAdd secrets in GitHub.
Using Console: CodePipeline > Create > Source: GitHub, Build: CodeBuild (Docker build spec), Deploy: ECS. Ready to transform your business with our technology solutions? Contact Us today to Leverage Our DevOps Expertise.
Contact Us