Add README.md #31
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
on: | |
push: | |
branches: | |
- master | |
jobs: | |
docker: | |
name: Build and push Docker image | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: arm64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2.0.0 | |
with: | |
audience: gha-mkuznets | |
role-to-assume: arn:aws:iam::299685316984:role/github-actions-mkuznets | |
aws-region: us-east-1 | |
- name: Login to Amazon ECR Public | |
uses: aws-actions/amazon-ecr-login@v1.5.3 | |
with: | |
registry-type: public | |
- name: Compute image metadata | |
id: image | |
run: | | |
TS=$(TZ=Etc/UTC date '+%Y%m%d%H%M%S') | |
SHA=$(git rev-parse --short "$GITHUB_SHA") | |
TAG="${TS}-${SHA}" | |
echo "tag=${TAG}" > "$GITHUB_OUTPUT" | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
platforms: linux/amd64,linux/arm64 | |
tags: |- | |
public.ecr.aws/mkuznets/jeepity:latest | |
public.ecr.aws/mkuznets/jeepity:${{ steps.image.outputs.tag }} |