Fix docker image url #4
This file contains 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: CD/ECR | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
name: ECR | |
runs-on: buildjet-4vcpu-ubuntu-2204-arm | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Submodules | |
run: git submodule init && git submodule update --remote | |
- 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: us-east-1 | |
- name: Get ECR Registry | |
id: ecr-login | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Login to ECR | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ steps.ecr-login.outputs.registry }} | |
- name: Set up Docker Buildkit | |
uses: docker/setup-buildx-action@v2 | |
with: | |
buildkitd-flags: --debug | |
- name: Get Tags for Image | |
id: metadata | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ steps.ecr-login.outputs.registry }}/escape-bot | |
tags: | | |
type=raw,value=latest | |
- name: Docker Build, Tag and Push to ECR | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
platforms: linux/arm64 | |
push: true | |
tags: ${{ steps.metadata.outputs.tags }} | |
build-args: GIT_SHA=${{ github.sha }} |