mirror of
https://github.com/craigerl/aprsd.git
synced 2026-01-20 20:46:28 -05:00
Try new tag Docker build action
This commit is contained in:
parent
f2bd594a89
commit
4d7dfcb6e9
57
.github/workflows/docker-multiarch-tag.yml
vendored
Normal file
57
.github/workflows/docker-multiarch-tag.yml
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
name: Build Multi-Arch Docker Image on Tag
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
- "*.*.*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set version from tag
|
||||
id: version
|
||||
run: |
|
||||
TAG="${{ github.ref_name }}"
|
||||
# Strip leading 'v' if present (e.g. v3.4.0 -> 3.4.0)
|
||||
VERSION="${TAG#v}"
|
||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels)
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: hemna6969/aprsd
|
||||
tags: |
|
||||
type=raw,value=${{ steps.version.outputs.version }},enable=${{ github.ref_type == 'tag' }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./docker
|
||||
file: ./docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
build-args: |
|
||||
INSTALL_TYPE=pypi
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
BUILDX_QEMU_ENV=true
|
||||
push: true
|
||||
provenance: false
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
Loading…
x
Reference in New Issue
Block a user