CF-4251:docker image for postgreSQL array fix #6
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
| name: Docker Build and Deploy | |
| on: | |
| push: | |
| branches: | |
| - fix/postgresql-array-handling #branch name which is used for image building | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| permissions: | |
| contents: read | |
| packages: read | |
| env: | |
| ECR_REPOSITORY: atomhopper | |
| AWS_REGION: us-east-1 | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set Short commit SHA as image tag | |
| run: echo "IMAGE_TAG=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV | |
| - name: AWS ECR login | |
| run: | | |
| aws ecr get-login-password --region ${{ env.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com | |
| - name: Build docker image | |
| run: | | |
| docker build -f docker/Dockerfile \ | |
| --build-arg GITHUB_TOKEN=${{ secrets.PAT_FOR_DOCKER }} \ | |
| --build-arg GITHUB_ACTOR=${{ secrets.USER_ID }} \ | |
| -t ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} . | |
| - name: Push docker image to registry | |
| run: | | |
| docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} |