Skip to content

Publish ECR eksctl-build image #8

Publish ECR eksctl-build image

Publish ECR eksctl-build image #8

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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
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@fc3959cb4cf5a821ab7a5a636ea4f1e855b05180 # 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@fac708d6674e30b6ba41289acaab6d4b75aa0753 #v4.0.1
with:
go-version: 1.18.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