From 245f1c267b9c63443708e80f3dbb6b2f676f35cd Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 18 Jan 2021 14:59:31 +0100 Subject: Rework docker build to use new docker build action --- .github/workflows/update-base.yaml | 60 +++++++++++++++----------------------- 1 file changed, 24 insertions(+), 36 deletions(-) (limited to '.github/workflows/update-base.yaml') diff --git a/.github/workflows/update-base.yaml b/.github/workflows/update-base.yaml index ed250262e7..081480492a 100644 --- a/.github/workflows/update-base.yaml +++ b/.github/workflows/update-base.yaml @@ -9,48 +9,36 @@ on: ## Build base images to be used by other github workflows jobs: - build-debian-64bit: + build: + name: Update base Erlang/OTP build images if: github.repository == 'erlang/otp' runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build and push 64-bit base image - uses: docker/build-push-action@v1 - with: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: docker.pkg.github.com - dockerfile: .github/dockerfiles/Dockerfile.debian-base - repository: erlang/otp/debian-base - tags: latest - build-debian-32bit: - if: github.repository == 'erlang/otp' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build and push 32-bit base image - uses: docker/build-push-action@v1 - with: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: docker.pkg.github.com - dockerfile: .github/dockerfiles/Dockerfile.debian-base - build_args: "BASE=i386/debian" - repository: erlang/otp/i386-debian-base - tags: latest + strategy: + matrix: + type: [debian-base,ubuntu-base,i386-debian-base] - build-ubuntu-64bit: - if: github.repository == 'erlang/otp' - runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Build and push 64-bit base image - uses: docker/build-push-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + driver: docker + - name: Docker login + uses: docker/login-action@v1 with: + registry: docker.pkg.github.com username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - registry: docker.pkg.github.com - dockerfile: .github/dockerfiles/Dockerfile.ubuntu-base - repository: erlang/otp/ubuntu-base - tags: latest + - name: Calculate BASE image + id: base + run: .github/scripts/base-tag "${{ matrix.type }}" + - name: Build and push base image + uses: docker/build-push-action@v2 + with: + context: . + file: .github/dockerfiles/Dockerfile.${{ steps.base.outputs.BASE_TYPE }} + pull: true + push: true + build-args: BASE=${{ steps.base.outputs.BASE }} + tags: docker.pkg.github.com/${{ github.repository }}/${{ matrix.type }}:latest -- cgit v1.2.1