From e3878eab9ff126d42f71f4be2be717ed5fd54cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20L=C3=B6nnegren?= Date: Tue, 17 Sep 2024 15:11:14 +0200 Subject: [PATCH] Add push-images workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A starting point for a workflow that will build and push the elemental-toolkit images to ghcr.io. Signed-off-by: Fredrik Lönnegren --- .github/workflows/push-images.yaml | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/push-images.yaml diff --git a/.github/workflows/push-images.yaml b/.github/workflows/push-images.yaml new file mode 100644 index 00000000000..cc9f859844b --- /dev/null +++ b/.github/workflows/push-images.yaml @@ -0,0 +1,42 @@ +name: Build and push images + +on: + push: + tags: + - 'v*.*.*' + workflow_dispatch: + inputs: + platforms: + type: string + default: linux/x86_64,linux/arm64 + +jobs: + build-toolkit: + permissions: + packages: write + runs-on: ubuntu-latest + env: + TOOLKIT_REPO: ghcr.io/${{github.repository}}/elemental-cli + REPO: ghcr.io/${{github.repository}}/elemental-${{ github.event.inputs.flavor }} + steps: + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Buildx + uses: docker/setup-buildx-action@v3 + with: + install: true + - uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + - run: | + git fetch --prune --unshallow + - name: Log in to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build toolkit + if: ${{ github.event.inputs.build-toolkit }} + run: | + make PLATFORM=${{ github.event.inputs.platforms }} DOCKER_ARGS=--push VERSION=${{ github.ref_name }} build