Merge pull request #15 from AutoLabeling-dotdot/feature/job-progress #12
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: Build and Push CVAT Images to ECR | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| build-and-push: | |
| name: Build & Push Docker Images | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Checkout source | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| # Step 2: Configure AWS Credentials | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v3 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ap-southeast-1 | |
| # Step 3: Login to Amazon ECR | |
| - name: Login to Amazon ECR | |
| id: login-ecr | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| # Step 4: Build server image | |
| - name: Build Server Image | |
| run: | | |
| docker build -t cvat-server:prod -f Dockerfile . | |
| # Step 5: Tag server image | |
| - name: Tag Server Image | |
| run: | | |
| docker tag cvat-server:prod \ | |
| ${{ steps.login-ecr.outputs.registry }}/bytesize/cvat-dotdot-server:prod | |
| # Step 6: Push server image | |
| - name: Push Server Image | |
| run: | | |
| docker push ${{ steps.login-ecr.outputs.registry }}/bytesize/cvat-dotdot-server:prod | |
| # Step 7: Build UI image | |
| - name: Build UI Image | |
| run: | | |
| docker build --no-cache \ | |
| --build-arg NGINX_CONF=react_nginx.prod.conf \ | |
| -t cvat-ui:prod -f Dockerfile.ui . | |
| # Step 8: Tag UI image | |
| - name: Tag UI Image | |
| run: | | |
| docker tag cvat-ui:prod \ | |
| ${{ steps.login-ecr.outputs.registry }}/bytesize/cvat-dotdot-ui:prod | |
| # Step 9: Push UI image | |
| - name: Push UI Image | |
| run: | | |
| docker push ${{ steps.login-ecr.outputs.registry }}/bytesize/cvat-dotdot-ui:prod |