Gitea workflow to build docker image

This commit is contained in:
2026-07-08 10:52:15 +02:00
parent d3cdc7d4ba
commit 7bdf1e5df3
5 changed files with 51 additions and 115 deletions
+51
View File
@@ -0,0 +1,51 @@
name: Build and push ha-elegoo-spaghetti-detection image
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag'
required: true
type: string
default: 'v1.0.0'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Docker login
run: |
echo "${{ secrets.ACCESS_TOKEN }}" | docker login gitea.furb.it \
-u "${{ secrets.USERNAME }}" \
--password-stdin
# Build image with tag
- name: Build Docker image
working-directory: ./addon
run: |
docker build \
-f Dockerfile.standalone.base \
--label ha-elegoo-spaghetti-detection.tag=${{ inputs.tag }} \
-t gitea.furb.it/docker/ha-elegoo-spaghetti-detection:latest \
-t gitea.furb.it/docker/ha-elegoo-spaghetti-detection:${{ inputs.tag }} \
.
# Push images
- name: Push Docker images
run: |
docker push gitea.furb.it/docker/ha-elegoo-spaghetti-detection:latest
docker push gitea.furb.it/docker/ha-elegoo-spaghetti-detection:${{ inputs.tag }}
# Create release using gitea-release-action
- name: Create release
uses: akkuman/gitea-release-action@v1
with:
server: "https://gitea.furb.it"
token: ${{ secrets.ACCESS_TOKEN }}
repository: Docker/ha-elegoo-spaghetti-detection
tag_name: ${{ inputs.tag }}
name: ${{ inputs.tag }}
body: "Docker image: `gitea.furb.it/docker/ha-elegoo-spaghetti-detection:${{ inputs.tag }}`"