Skip to content

Commit

Permalink
Docker: tag intermediate containers
Browse files Browse the repository at this point in the history
  • Loading branch information
vidplace7 committed Jan 22, 2025
1 parent 7fb22cf commit 66467d2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ jobs:
ref: ${{github.event.pull_request.head.ref}}
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
if: ${{ inputs.push }}
uses: docker/login-action@v3
Expand All @@ -61,6 +66,20 @@ jobs:
- name: Docker setup
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
uses: docker/build-push-action@v6
id: docker_variant
Expand All @@ -69,5 +88,5 @@ jobs:
file: |
${{ contains(inputs.distro, 'debian') && './Dockerfile' || contains(inputs.distro, 'alpine') && './alpine.Dockerfile' }}
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 }}
1 change: 1 addition & 0 deletions .github/workflows/docker_manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ jobs:
with:
images: meshtastic/meshtasticd
tags: ${{ steps.tags.outputs.debian }}
flavor: latest=false

- name: Create Docker manifest (Debian)
id: manifest_debian
Expand Down

0 comments on commit 66467d2

Please sign in to comment.