From 68b9927c3b3989a82ff736ed5a50f352adffbeb8 Mon Sep 17 00:00:00 2001 From: Nicolas Vuillamy Date: Sat, 19 Oct 2024 18:41:26 +0200 Subject: [PATCH] CI: Also prune volumes before pulling and pushing to docker hub (#4165) --- .github/workflows/deploy-ALPHA-flavors.yml | 2 +- .github/workflows/deploy-ALPHA.yml | 2 +- .github/workflows/deploy-BETA-flavors.yml | 4 ++-- .github/workflows/deploy-BETA-linters.yml | 2 +- .github/workflows/deploy-BETA.yml | 6 +++--- .github/workflows/deploy-RELEASE-flavors.yml | 4 ++-- .github/workflows/deploy-RELEASE.yml | 4 ++-- CHANGELOG.md | 1 + 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy-ALPHA-flavors.yml b/.github/workflows/deploy-ALPHA-flavors.yml index 3f3b6941db2..7df27ac756f 100644 --- a/.github/workflows/deploy-ALPHA-flavors.yml +++ b/.github/workflows/deploy-ALPHA-flavors.yml @@ -142,7 +142,7 @@ jobs: # Copy ghrc.io image to Docker Hub - name: Pull image from GHCR - run: docker system prune -a --force && docker pull ghcr.io/oxsecurity/megalinter-worker-${{ matrix.flavor }}:alpha + run: docker system prune -a --volumes --force && docker pull ghcr.io/oxsecurity/megalinter-worker-${{ matrix.flavor }}:alpha - name: Tag image for Docker Hub run: docker tag ghcr.io/oxsecurity/megalinter-worker-${{ matrix.flavor }}:alpha oxsecurity/megalinter-worker-${{ matrix.flavor }}:alpha - name: Push image to Docker Hub diff --git a/.github/workflows/deploy-ALPHA.yml b/.github/workflows/deploy-ALPHA.yml index e029e50303b..3af1f6f65d0 100644 --- a/.github/workflows/deploy-ALPHA.yml +++ b/.github/workflows/deploy-ALPHA.yml @@ -150,7 +150,7 @@ jobs: # Copy ghrc.io image to Docker Hub - name: Pull image from GHCR - run: docker system prune -a --force && docker system prune -a --force && docker pull ghcr.io/oxsecurity/megalinter:alpha + run: docker system prune -a --volumes --force && docker system prune -a --volumes --force && docker pull ghcr.io/oxsecurity/megalinter:alpha - name: Tag image for Docker Hub run: docker tag ghcr.io/oxsecurity/megalinter:alpha oxsecurity/megalinter:alpha - name: Push image to Docker Hub diff --git a/.github/workflows/deploy-BETA-flavors.yml b/.github/workflows/deploy-BETA-flavors.yml index 74f1d9132d6..bb5119fc655 100644 --- a/.github/workflows/deploy-BETA-flavors.yml +++ b/.github/workflows/deploy-BETA-flavors.yml @@ -202,7 +202,7 @@ jobs: - name: Debug output run: "echo \"Tag steps.meta.outputs.tags: ${{ steps.meta.outputs.tags }}\"" - name: Pull image from GHCR - run: docker system prune -a --force && docker pull "${{ steps.meta.outputs.tags }}" + run: docker system prune -a --volumes --force && docker pull "${{ steps.meta.outputs.tags }}" - name: Tag image for Docker Hub run: docker tag "${{ steps.meta.outputs.tags }}" "${{ steps.meta-dhub.outputs.tags }}" - name: Push image to Docker Hub @@ -210,7 +210,7 @@ jobs: # Copy ghrc.io image to Docker Hub (worker) - name: Pull image from GHCR - run: docker system prune -a --force && docker pull "${{ steps.meta-w.outputs.tags }}" + run: docker system prune -a --volumes --force && docker pull "${{ steps.meta-w.outputs.tags }}" - name: Tag image for Docker Hub run: docker tag "${{ steps.meta-w.outputs.tags }}" "${{ steps.meta-w-dhub.outputs.tags }}" - name: Push image to Docker Hub diff --git a/.github/workflows/deploy-BETA-linters.yml b/.github/workflows/deploy-BETA-linters.yml index c649d845738..78f53033125 100644 --- a/.github/workflows/deploy-BETA-linters.yml +++ b/.github/workflows/deploy-BETA-linters.yml @@ -272,7 +272,7 @@ jobs: - name: Debug output run: "echo \"Tag steps.meta.outputs.tags: ${{ fromJson(steps.meta-dhub.outputs.json).tags[0]}}\"" - name: Pull image from GHCR - run: docker system prune -a --force && docker pull "${{ fromJson(steps.meta.outputs.json).tags[0]}}" + run: docker system prune -a --volumes --force && docker pull "${{ fromJson(steps.meta.outputs.json).tags[0]}}" - name: Tag image for Docker Hub run: docker tag "${{ fromJson(steps.meta.outputs.json).tags[0]}}" "${{ fromJson(steps.meta-dhub.outputs.json).tags[0]}}" - name: Push image to Docker Hub diff --git a/.github/workflows/deploy-BETA.yml b/.github/workflows/deploy-BETA.yml index 90a90b17ac0..b89927094ab 100644 --- a/.github/workflows/deploy-BETA.yml +++ b/.github/workflows/deploy-BETA.yml @@ -203,7 +203,7 @@ jobs: # Copy ghrc.io image to Docker Hub (main image) - name: Pull image from GHCR - run: docker system prune -a --force && docker pull "${{ steps.meta.outputs.tags }}" + run: docker system prune -a --volumes --force && docker pull "${{ steps.meta.outputs.tags }}" - name: Tag image for Docker Hub run: docker tag "${{ steps.meta.outputs.tags }}" "${{ steps.meta-dhub.outputs.tags }}" - name: Push image to Docker Hub @@ -211,7 +211,7 @@ jobs: # Copy ghrc.io image to Docker Hub (server) - name: Pull image from GHCR - run: docker system prune -a --force && docker pull "${{ steps.meta-s.outputs.tags }}" + run: docker system prune -a --volumes --force && docker pull "${{ steps.meta-s.outputs.tags }}" - name: Tag image for Docker Hub run: docker tag "${{ steps.meta-s.outputs.tags }}" "${{ steps.meta-s-dhub.outputs.tags }}" - name: Push image to Docker Hub @@ -219,7 +219,7 @@ jobs: # Copy ghrc.io image to Docker Hub (worker) - name: Pull image from GHCR - run: docker system prune -a --force && docker pull "${{ steps.meta-w.outputs.tags }}" + run: docker system prune -a --volumes --force && docker pull "${{ steps.meta-w.outputs.tags }}" - name: Tag image for Docker Hub run: docker tag "${{ steps.meta-w.outputs.tags }}" "${{ steps.meta-w-dhub.outputs.tags }}" - name: Push image to Docker Hub diff --git a/.github/workflows/deploy-RELEASE-flavors.yml b/.github/workflows/deploy-RELEASE-flavors.yml index 2938ec5da14..105c90a01f3 100644 --- a/.github/workflows/deploy-RELEASE-flavors.yml +++ b/.github/workflows/deploy-RELEASE-flavors.yml @@ -134,7 +134,7 @@ jobs: # Copy ghrc.io image to Docker Hub (main image) - name: Pull image from GHCR - run: docker system prune -a --force && docker pull ghcr.io/oxsecurity/megalinter-${{ matrix.flavor }}:v8 + run: docker system prune -a --volumes --force && docker pull ghcr.io/oxsecurity/megalinter-${{ matrix.flavor }}:v8 - name: Tag image for Docker Hub run: docker tag ghcr.io/oxsecurity/megalinter-${{ matrix.flavor }}:v8 docker.io/oxsecurity/megalinter-${{ matrix.flavor }}:v8 @@ -153,7 +153,7 @@ jobs: # Copy ghrc.io image to Docker Hub (worker) - name: Pull image from GHCR - run: docker system prune -a --force && docker pull ghcr.io/oxsecurity/megalinter-worker-${{ matrix.flavor }}:v8 + run: docker system prune -a --volumes --force && docker pull ghcr.io/oxsecurity/megalinter-worker-${{ matrix.flavor }}:v8 - name: Tag image for Docker Hub run: docker tag ghcr.io/oxsecurity/megalinter-worker-${{ matrix.flavor }}:v8 docker.io/oxsecurity/megalinter-worker-${{ matrix.flavor }}:v8 diff --git a/.github/workflows/deploy-RELEASE.yml b/.github/workflows/deploy-RELEASE.yml index 624919bc9fc..a9d5ce9bbd5 100644 --- a/.github/workflows/deploy-RELEASE.yml +++ b/.github/workflows/deploy-RELEASE.yml @@ -130,7 +130,7 @@ jobs: # Copy ghrc.io image to Docker Hub (main image) - name: Pull image from GHCR - run: docker system prune -a --force && docker pull ghcr.io/oxsecurity/megalinter:v8 + run: docker system prune -a --volumes --force && docker pull ghcr.io/oxsecurity/megalinter:v8 - name: Tag image for Docker Hub run: docker tag ghcr.io/oxsecurity/megalinter:v8 docker.io/oxsecurity/megalinter:v8 - name: Push image to Docker Hub v8 @@ -146,7 +146,7 @@ jobs: # Copy ghrc.io image to Docker Hub (worker) - name: Pull image from GHCR (Worker) - run: docker system prune -a --force && docker pull ghcr.io/oxsecurity/megalinter-worker:v8 + run: docker system prune -a --volumes --force && docker pull ghcr.io/oxsecurity/megalinter-worker:v8 - name: Tag image for Docker Hub run: docker tag ghcr.io/oxsecurity/megalinter-worker:v8 docker.io/oxsecurity/megalinter-worker:v8 - name: Push image to Docker Hub v8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 05d6886e102..bb28f1dd5e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l - Flavors - CI + - Also prune volumes before pulling and pushing to docker hub - mega-linter-runner