forked from nxtlytics/ivy-homebrew
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (42 loc) · 1.46 KB
/
build_image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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 }}