From 3946b78e6be35c9764dac018d8f9dfc72e026df2 Mon Sep 17 00:00:00 2001 From: Tadas Sutkaitis Date: Sat, 13 Jan 2024 01:42:45 +0200 Subject: [PATCH] fix: move image job to release --- .github/workflows/image.yml | 45 ----------------------------------- .github/workflows/release.yml | 39 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/image.yml diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml deleted file mode 100644 index bd5b13b..0000000 --- a/.github/workflows/image.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: image - -on: - release: - types: - - published - -jobs: - image: - runs-on: ubuntu-latest - steps: - - name: Install QEMU static binaries - uses: docker/setup-qemu-action@v3.0.0 - - - name: Configure Buildkit - uses: docker/setup-buildx-action@v3.0.0 - - - name: Checkout project - uses: actions/checkout@v4 - - - name: Authenticate with Quay.io - uses: docker/login-action@v3.0.0 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_ROBOT_TOKEN }} - - - name: Generate image tag - id: image_tag - run: | - echo tag=$(echo ${{ github.event.release.tag_name }} | sed 's/^v//') >> $GITHUB_OUTPUT - - - name: Build image - uses: docker/build-push-action@v5.1.0 - with: - context: . - cache-from: type=gha - cache-to: type=gha,mode=max - push: true - platforms: | - linux/amd64 - linux/arm64 - tags: | - quay.io/tadas/radosgw-exporter:latest - quay.io/tadas/radosgw-exporter:${{ steps.image_tag.outputs.tag }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aced2e9..34c20ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,3 +28,42 @@ args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + image: + runs-on: ubuntu-latest + steps: + - name: Install QEMU static binaries + uses: docker/setup-qemu-action@v3.0.0 + + - name: Configure Buildkit + uses: docker/setup-buildx-action@v3.0.0 + + - name: Checkout project + uses: actions/checkout@v4 + + - name: Authenticate with Quay.io + uses: docker/login-action@v3.0.0 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_ROBOT_TOKEN }} + + - name: Generate image tag + id: image_tag + run: | + echo tag=$(echo ${{ github.event.ref }} | sed 's/^v//') >> $GITHUB_OUTPUT + + - name: Build image + uses: docker/build-push-action@v5.1.0 + with: + context: . + cache-from: type=gha + cache-to: type=gha,mode=max + push: true + platforms: | + linux/amd64 + linux/arm64 + tags: | + quay.io/tadas/radosgw-exporter:latest + quay.io/tadas/radosgw-exporter:${{ steps.image_tag.outputs.tag }} + \ No newline at end of file