From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0CF4D158089 for ; Sat, 14 Oct 2023 17:19:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 425882BC025; Sat, 14 Oct 2023 17:19:58 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2663F2BC025 for ; Sat, 14 Oct 2023 17:19:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 12237335C31 for ; Sat, 14 Oct 2023 17:19:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 885D7118D for ; Sat, 14 Oct 2023 17:19:55 +0000 (UTC) From: "John Helmert III" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "John Helmert III" Message-ID: <1697303986.d7e9b1ab0b92cc81c0cc6c589e713c78e8b8df2b.ajak@gentoo> Subject: [gentoo-commits] proj/docker-images:master commit in: .github/workflows/, .github/actions/container_build/ X-VCS-Repository: proj/docker-images X-VCS-Files: .github/actions/container_build/action.yml .github/workflows/build.yml X-VCS-Directories: .github/workflows/ .github/actions/container_build/ X-VCS-Committer: ajak X-VCS-Committer-Name: John Helmert III X-VCS-Revision: d7e9b1ab0b92cc81c0cc6c589e713c78e8b8df2b X-VCS-Branch: master Date: Sat, 14 Oct 2023 17:19:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 66800501-6ac0-49b0-bfd2-2227da7e8b7f X-Archives-Hash: e0dfaac4b846cba4f78423c8b0797535 commit: d7e9b1ab0b92cc81c0cc6c589e713c78e8b8df2b Author: John Helmert III gentoo org> AuthorDate: Sat Oct 14 17:19:46 2023 +0000 Commit: John Helmert III gentoo org> CommitDate: Sat Oct 14 17:19:46 2023 +0000 URL: https://gitweb.gentoo.org/proj/docker-images.git/commit/?id=d7e9b1ab split iamge build steps into dedicated actions file Signed-off-by: John Helmert III gentoo.org> .github/actions/container_build/action.yml | 46 ++++++++++++++++++++++++++++++ .github/workflows/build.yml | 32 ++++----------------- 2 files changed, 51 insertions(+), 27 deletions(-) diff --git a/.github/actions/container_build/action.yml b/.github/actions/container_build/action.yml new file mode 100644 index 0000000..bef1441 --- /dev/null +++ b/.github/actions/container_build/action.yml @@ -0,0 +1,46 @@ +--- +name: Build +inputs: + target: + required: true + dockerhub_username: + required: true + dockerhub_password: + required: true +runs: + using: composite + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up buildx + uses: docker/setup-buildx-action@v2 + - name: Set up TARGET + run: echo "TARGET=${{ inputs.target }}" | tee $GITHUB_ENV + shell: bash + - name: Build image + if: startswith(inputs.target, 'stage3') || startswith(inputs.target, 'portage') + shell: bash + run: ./build.sh + - name: Build python image + if: startswith(inputs.target, 'python') + shell: bash + run: ./build-python.sh + - name: Inspect image + shell: bash + run: docker image inspect "${ORG}/${TARGET/-/:}" + - name: Inspect portage + if: matrix.target != 'portage' + shell: bash + run: docker run --rm "${ORG}/${TARGET/-/:}" emerge --info + - name: Login to DockerHub + uses: docker/login-action@v2 + if: github.event_name == 'schedule' + with: + username: ${{ inputs.dockerhub_username }} + password: ${{ inputs.dockerhub_password }} + - name: Push image + if: github.event_name == 'schedule' + shell: bash + env: + DOCKER_CLI_EXPERIMENTAL: enabled + run: ./deploy.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef4e56f..cb95b19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,34 +58,12 @@ jobs: - stage3-s390x-systemd name: ${{ matrix.target }} runs-on: ubuntu-latest - env: - TARGET: ${{ matrix.target }} steps: - name: Checkout code uses: actions/checkout@v3 - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up buildx - uses: docker/setup-buildx-action@v2 - - name: Build image - if: startswith(matrix.target, 'stage3') || startswith(matrix.target, 'portage') - run: ./build.sh - - name: Build python image - if: startswith( matrix.target, 'python') - run: ./build-python.sh - - name: Inspect image - run: docker image inspect "${ORG}/${TARGET/-/:}" - - name: Inspect portage - if: matrix.target != 'portage' - run: docker run --rm "${ORG}/${TARGET/-/:}" emerge --info - - name: Login to DockerHub - uses: docker/login-action@v2 - if: github.event_name == 'schedule' + - name: Build ${{ matrix.target }} + uses: ./.github/actions/container_build with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Push image - if: github.event_name == 'schedule' - env: - DOCKER_CLI_EXPERIMENTAL: enabled - run: ./deploy.sh + target: ${{ matrix.target }} + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}