Open AshciR opened 6 months ago
name: Set up Docker Buildx uses: docker/setup-buildx-action@v2
name: Log in to Amazon ECR id: ecr-login uses: aws-actions/amazon-ecr-login@v1 with: registry: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com
name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }}
name: Build Docker image run: | docker build -t my-app:latest .
name: Tag Docker image run: | docker tag my-app:latest ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/my-app:latest
name: Push Docker image to ECR run: | docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/my-app:latest
We want the ability to build, version (tag), and push the images after successful merges to
main