From 81dd7e3c3ac787d50bdedb43c892fc6b086b18ca Mon Sep 17 00:00:00 2001 From: Dinar Valeev Date: Tue, 19 Nov 2024 23:51:27 +0100 Subject: [PATCH] Add image build action Signed-off-by: Dinar Valeev --- .github/workflows/build-docker.yml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/build-docker.yml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000000..20507d0849 --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,38 @@ +name: "build container image" + +on: + push: + branches: + - main +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version: '1.22' + id: go + - name: Build binary + run: | + make managers + - name: 'Login to GitHub Container Registry' + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + - name: build container image + env: + REGISTRY: ghcr.io/absaoss + TAG: v2.7.2 + run: | + make docker-build + - name: publish image + run: | + docker push ghcr.io/absaoss/cluster-api-aws-controller-amd64:v2.7.2