Merge pull request #2 from ATOAPaymentsLimited/chatwoot-develop #3
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
| on: | |
| push: | |
| branches: [develop] | |
| name: docker build to ECR | |
| jobs: | |
| deploy: | |
| name: Deploy | |
| runs-on: | |
| group: ActionRunnerLocalGroup | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v1 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: eu-west-2 | |
| - name: Login to Amazon ECR | |
| id: login-ecr | |
| env: | |
| ECR_REGISTRY: ${{ secrets.ECR_REGISTRY }} | |
| run: aws ecr get-login-password --region eu-west-2 | docker login --username AWS --password-stdin $ECR_REGISTRY | |
| - name: Build, tag, and push the image to Amazon ECR | |
| id: build-image | |
| env: | |
| ECR_REGISTRY: ${{ secrets.ECR_REGISTRY }} | |
| ECR_REPOSITORY: ${{ secrets.REPO_NAME }} | |
| IMAGE_TAG: ${{ github.sha }} | |
| run: | | |
| # Build a docker container and push it to ECR | |
| docker build -f docker/Dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . | |
| echo "Pushing image to ECR..." | |
| docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG |