Skip to content

Commit

Permalink
CI: Also prune volumes before pulling and pushing to docker hub (#4165)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam authored Oct 19, 2024
1 parent 0803f28 commit 68b9927
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-ALPHA-flavors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-ALPHA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-BETA-flavors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ 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
run: docker push "${{ steps.meta-dhub.outputs.tags }}"

# 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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-BETA-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-BETA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,23 +203,23 @@ 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
run: docker push "${{ steps.meta-dhub.outputs.tags }}"

# 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
run: docker push "${{ steps.meta-s-dhub.outputs.tags }}"

# 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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-RELEASE-flavors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-RELEASE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 68b9927

Please sign in to comment.