From 8dcd5d7cb414773765f942c78d63aba280b9b34d Mon Sep 17 00:00:00 2001 From: Ievgen Popovych Date: Tue, 14 Mar 2023 17:53:43 +0100 Subject: [PATCH] .github/workflows: Publish the Ubuntu images at quay.io/toolbx/... Until now, the Ubuntu images (versions 16.04, 18.04, 20.04, 22.04 and 22.10) were published at quay.io/toolbx-images/ubuntu-toolbox:22.04, etc.. This changes the location to quay.io/toolbx/ubuntu-toolbox:22.04 and builds an image for Ubuntu 23.04 that was added recently [1]. Build and push when there are changes in the `images/ubuntu` directory or in the GitHub workflow itself, as well as every other week (7th and 21st days of a month to be precise). The toolbox(1) code and the system tests will be switched to the new location after the first round of images are available. [1] Commit 3cfb6bf888a1ddce https://github.com/containers/toolbox/pull/1292 https://github.com/containers/toolbox/pull/483 Signed-off-by: Ievgen Popovych --- .github/workflows/ubuntu-images.yaml | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/ubuntu-images.yaml diff --git a/.github/workflows/ubuntu-images.yaml b/.github/workflows/ubuntu-images.yaml new file mode 100644 index 0000000..11de703 --- /dev/null +++ b/.github/workflows/ubuntu-images.yaml @@ -0,0 +1,61 @@ +name: "Images: Build and push Ubuntu toolbx images" + +on: + push: + branches: + - main + paths: + - images/ubuntu/** + - .github/workflows/ubuntu-images.yaml + schedule: + - cron: '0 0 * * MON' + +# Prevent multiple workflow runs from racing +concurrency: ${{ github.workflow }} + +env: + latest_release: '22.04' + +jobs: + build-and-push-images: + strategy: + matrix: + release: ['16.04', '18.04', '20.04', '22.04', '22.10', '23.04'] + + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Quay.io + uses: docker/login-action@v2 + with: + registry: quay.io + username: 'toolbx+github' + password: ${{ secrets.QUAY_ROBOT_TOKEN }} + + - name: Build and push Ubuntu ${{ matrix.release }} toolbox image + uses: docker/build-push-action@v3 + with: + context: images/ubuntu/${{ matrix.release }} + file: images/ubuntu/${{ matrix.release }}/Containerfile + platforms: linux/amd64,linux/arm64 + push: true + no-cache: true + tags: quay.io/toolbx/ubuntu-toolbox:${{ matrix.release }} + + - name: Push latest tag + if: env.latest_release == matrix.release + uses: docker/build-push-action@v3 + with: + context: images/ubuntu/${{ matrix.release }} + file: images/ubuntu/${{ matrix.release }}/Containerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: quay.io/toolbx/ubuntu-toolbox:latest