Skip to content

Publish ECR eksctl-build image #13

Publish ECR eksctl-build image

Publish ECR eksctl-build image #13

name: Publish ECR eksctl-build image
on: workflow_dispatch
permissions:
id-token: write
contents: read
jobs:
build-and-push-to-registry:
name: Build and push container image
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@04b98b3f9e85f563fb061be8751a0352327246b0 # v3.0.1
with:
aws-region: us-east-1
role-duration-seconds: 7200
role-session-name: eksctl-build-ecr-publisher
role-to-assume: ${{ secrets.ECR_PUBLISH_ROLE_ARN }}
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@2fc7aceee09e9e4a7105c0d060c656fad0b4f63d # v1
with:
registry-type: public
- name: Cache go-build and mod
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 #v3.3.1
with:
path: |
~/.cache/go-build/
~/go/pkg/mod/
key: go-${{ hashFiles('go.sum') }}
restore-keys: |
go-
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe #v4.1.0
with:
go-version: 1.20.x
- name: Setup deps
run: |
make install-build-deps
- name: Build and push image
run: |
PATH=$PATH:$(go env GOPATH)/bin make -f Makefile.docker push-build-image