|
89 | 89 | uses: actions/checkout@v3 |
90 | 90 | with: |
91 | 91 | ref: '${{ steps.setup.outputs.branch_ref }}' |
| 92 | + |
| 93 | + - name: Determine environment |
| 94 | + id: determine_environment |
| 95 | + run: | |
| 96 | + if [ "${{ github.ref_name }}" = "master" ]; then |
| 97 | + echo "::set-output name=environment::prod" |
| 98 | + else |
| 99 | + echo "::set-output name=environment::${{ github.ref_name }}" |
| 100 | + fi |
92 | 101 |
|
93 | 102 | - name: 'Bump build version' |
94 | 103 | id: bump-build-version |
@@ -118,6 +127,21 @@ jobs: |
118 | 127 | branch-name: '${{ steps.setup.outputs.branch_name }}' |
119 | 128 | commit-author: 'github_actions' |
120 | 129 | commit-message: 'feat(release): build ${{ steps.versioning.outputs.version }}' |
| 130 | + |
| 131 | + - name: 'Build and push docker image to AWS ECR' |
| 132 | + id: aws-build-push-image |
| 133 | + uses: valispace/actions/aws-build-push-image@master |
| 134 | + with: |
| 135 | + aws-secret-access-key: '${{ secrets.AWS_SECRET_ACCESS_KEY }}' |
| 136 | + aws-access-key-id: '${{ secrets.AWS_ACCESS_KEY_ID }}' |
| 137 | + aws-ecr-repository: '${{ github.event.repository.name }}' |
| 138 | + aws-s3-bucket: '${{ secrets.S3_BUCKET }}' |
| 139 | + aws-s3-repository: '${{ github.event.repository.name }}' |
| 140 | + aws-s3-branch: '${{ github.ref_name }}' |
| 141 | + dockerfile-path: 'docker/backend/Dockerfile' |
| 142 | + version: '${{ steps.versioning.outputs.version }}' |
| 143 | + environment: '${{ steps.determine_environment.outputs.environment }}' |
| 144 | + archive-name: '${{ github.event.repository.name }}-docker' |
121 | 145 |
|
122 | 146 | - name: 'Build docker image' |
123 | 147 | id: docker-build-image |
|
0 commit comments