Save the docker images to Amazon ECR
ECR = Amazon Elastic Container Registry

See https://github.com/huggingface/datasets-preview-backend/blob/dockerize/.github/workflows/docker.yml by @XciD 

```yml
name: '[ALL] Build docker images'

on:
  workflow_dispatch:
  push:

env:
  REGISTRY: 707930574880.dkr.ecr.us-east-1.amazonaws.com
  REGION: us-east-1

jobs:
  build-and-push-image:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Set outputs
        id: vars
        run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
      - 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: ${{ env.REGION }}
      - name: Login to Amazon ECR
        id: login-ecr
        uses: aws-actions/amazon-ecr-login@v1
      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
        with:
          images: ${{ env.REGISTRY }}/hub-dataset-server
          tags: |
            type=raw,value=sha-${{ steps.vars.outputs.sha_short }}
      - name: Build and push Docker image
        uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
        with:
          context: .
          build-args: COMMIT=${{ steps.vars.outputs.sha_short }}
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
```
Save the docker images to Amazon ECR: ECR = Amazon Elastic Container Registry

See https://github.com/huggingface/datasets-preview-backend/blob/dockerize/.github/workflows/docker.yml by @XciD 

```yml
name: '[ALL] Build docker images'

on:
  workflow_dispatch:
  push:

env:
  REGISTRY: 707930574880.dkr.ecr.us-east-1.amazonaws.com
  REGION: us-east-1

jobs:
  build-and-push-image:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Set outputs
        id: vars
        run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
      - 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: ${{ env.REGION }}
      - name: Login to Amazon ECR
        id: login-ecr
        uses: aws-actions/amazon-ecr-login@v1
      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
        with:
          images: ${{ env.REGISTRY }}/hub-dataset-server
          tags: |
            type=raw,value=sha-${{ steps.vars.outputs.sha_short }}
      - name: Build and push Docker image
        uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
        with:
          context: .
          build-args: COMMIT=${{ steps.vars.outputs.sha_short }}
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
```