Add GitHub Actions workflow for Docker image build

This commit is contained in:
mukowman 2026-02-19 18:36:40 +11:00 committed by GitHub
parent 3f99f17409
commit 5f6f1d92f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

47
.github/workflows/docker-build.yml vendored Normal file
View file

@ -0,0 +1,47 @@
name: Build and Publish Docker Image
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
pull_request:
env:
IMAGE_NAME: meshcore-multitcp
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/meshcore-multitcp
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tag