cd·docker #245
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·docker | |
| run-name: cd·docker | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - .github/workflows/cd.docker.yml | |
| - .github/Dockerfile | |
| - brewkit/**/*.ts | |
| workflow_dispatch: | |
| concurrency: | |
| group: docker | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: docker/auth | |
| run: echo "${{ github.token }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository_owner }}/bldbot | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| # TODO --platform linux/amd64,linux/arm64 | |
| - name: docker/buildx | |
| run: | | |
| docker buildx build \ | |
| --push \ | |
| --tag ghcr.io/${{ github.repository_owner }}/bldbot:latest \ | |
| --platform linux/amd64 \ | |
| --file .github/Dockerfile \ | |
| . | |
| prune: | |
| needs: deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/delete-package-versions@v5 | |
| with: | |
| package-name: bldbot | |
| package-type: container | |
| min-versions-to-keep: 10 | |
| # ^^ despite telling it to only delete untagged versions | |
| # it deletes images attached to latest like a lolfactory | |
| delete-only-untagged-versions: true |