Docker: tag intermediate containers (#5910)

This commit is contained in:
Austin 2025-01-22 09:55:57 -05:00 committed by GitHub
parent 7fb22cf678
commit 01892cbd1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View File

@ -48,6 +48,11 @@ jobs:
ref: ${{github.event.pull_request.head.ref}} ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}} repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Get release version string
run: |
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
id: version
- name: Docker login - name: Docker login
if: ${{ inputs.push }} if: ${{ inputs.push }}
uses: docker/login-action@v3 uses: docker/login-action@v3
@ -61,6 +66,20 @@ jobs:
- name: Docker setup - name: Docker setup
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Sanitize platform string
id: sanitize_platform
# Replace slashes with underscores
run: echo "cleaned_platform=${{ inputs.platform }}" | sed 's/\//_/g' >> $GITHUB_OUTPUT
- name: Docker tag
id: meta
uses: docker/metadata-action@v5
with:
images: meshtastic/meshtasticd
tags: |
GHA-${{ steps.version.outputs.long }}-${{ inputs.distro }}-${{ steps.sanitize_platform.outputs.cleaned_platform }}
flavor: latest=false
- name: Docker build and push - name: Docker build and push
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
id: docker_variant id: docker_variant
@ -69,5 +88,5 @@ jobs:
file: | file: |
${{ contains(inputs.distro, 'debian') && './Dockerfile' || contains(inputs.distro, 'alpine') && './alpine.Dockerfile' }} ${{ contains(inputs.distro, 'debian') && './Dockerfile' || contains(inputs.distro, 'alpine') && './alpine.Dockerfile' }}
push: ${{ inputs.push }} push: ${{ inputs.push }}
tags: "" # Intentionally empty, push with digest only tags: ${{ steps.meta.outputs.tags }} # Tag is only meant to be consumed by the "manifest" job
platforms: ${{ inputs.platform }} platforms: ${{ inputs.platform }}

View File

@ -145,6 +145,7 @@ jobs:
with: with:
images: meshtastic/meshtasticd images: meshtastic/meshtasticd
tags: ${{ steps.tags.outputs.debian }} tags: ${{ steps.tags.outputs.debian }}
flavor: latest=false
- name: Create Docker manifest (Debian) - name: Create Docker manifest (Debian)
id: manifest_debian id: manifest_debian