docs: remove prune script badge #358
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: cd | |
| on: | |
| push: | |
| branches: [main] | |
| schedule: | |
| - cron: "43 1 * * SUN" # every Sunday at 1:43 AM UTC | |
| workflow_dispatch: | |
| env: | |
| IMAGE_NAME: network-tools | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name != 'pull_request' }} | |
| permissions: | |
| packages: write | |
| contents: read | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@main | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Lint Dockerfile | |
| run: make lint | |
| - name: Extract metadata for images | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | |
| ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | |
| # manually handle the 'latest' tag | |
| flavor: | | |
| latest=false | |
| tags: | | |
| type=raw,value=latest | |
| type=sha,format=short | |
| labels: | | |
| org.opencontainers.image.licenses=MIT | |
| org.opencontainers.image.title=${{ env.IMAGE_NAME }} | |
| org.opencontainers.image.description=A Docker image with various network tools pre-installed | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push images | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| no-cache: true | |
| prune: | |
| needs: publish | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name != 'pull_request' }} | |
| permissions: | |
| packages: write | |
| contents: read | |
| env: | |
| GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }} | |
| DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
| DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
| steps: | |
| - name: Checkout Git repository | |
| uses: actions/checkout@main | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --requirement scripts/prune/requirements.txt | |
| - name: Prune old images | |
| run: python scripts/prune/main.py --container ${{ env.IMAGE_NAME }} --registry all --keep-latest 25 --verbose |