Skip to content

[GitHub Actions] Updated actions: #6

[GitHub Actions] Updated actions:

[GitHub Actions] Updated actions: #6

Workflow file for this run

name: Build homebrew image
on:
push:
tags:
- "v*"
permissions:
id-token: write # required to use OIDC authentication
contents: read
jobs:
build-and-push:
name: Build homebrew container and push to public ECR
runs-on: ubuntu-latest
steps:
- name: Get repo name
id: repoName
run: echo "REPONAME=$(echo ${{github.repository}} | cut -d '/' -f 2)" >> $GITHUB_OUTPUT
- name: Get the version
id: get-version
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::645843940509:role/github-actions-ecr-public-create-read-write
role-duration-seconds: 900 # Member must have value greater than or equal to 900
aws-region: us-east-1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: 'public'
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: |
public.ecr.aws/e5r9m0c5/${{ steps.repoName.outputs.REPONAME }}:${{ steps.get-version.outputs.VERSION }}