From 1412402a57f43a5feb8ced062dae0e20908c552e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Sell=C3=A9s?= Date: Tue, 30 Jan 2024 17:14:04 +0100 Subject: [PATCH] feat: build images from the ingress-nginx fork Change-Id: I3f1dd6e31dff8469ce6fcf2aa1f3836220bf8771 --- .github/workflows/build.yaml | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..a9cd29e71 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,48 @@ +name: build images + +on: + workflow_call: + push: + branches: [ "*", "**/*" ] + +jobs: + + buildImages: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v3 + with: + go-version: '^1.21' + + - name: Set up Docker context for Buildx + id: buildx-context + run: | + docker context create builders + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + with: + version: latest + endpoint: builders + + - run: go mod vendor + + - name: Login to Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build images + id: buildimages + run: | + img=ghcr.io/${{github.repository}}:${{github.sha}} + echo "::set-output name=IMAGE_NAME::${img}" + docker pull ${img} || ( + docker buildx build --push --cache-to type=gha,mode=max --cache-from type=gha --progress plain --platform linux/arm64/v8,linux/amd64 --build-arg BUILDKIT_INLINE_CACHE=1 -t ${img} . + )