mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-07-05 01:11:06 +02:00
bc578c7018
Automatically builds and pushes mc-webui image to Docker Hub (mawoj/mc-webui) on push to main, with manual trigger support. Tags: latest + version from git (e.g. 2026.04.01-b286072). Based on x9daniel's PR #21, adapted for Docker Hub. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: Build and Push mc-webui image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch: # Manual trigger
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Freeze App Version
|
|
run: python3 -m app.version freeze
|
|
|
|
- name: Extract version tag
|
|
id: get_tag
|
|
run: |
|
|
TAG_VALUE=$(grep "DOCKER_TAG =" app/version_frozen.py | cut -d'"' -f2)
|
|
echo "Extracted Tag: $TAG_VALUE"
|
|
echo "tag=$TAG_VALUE" >> $GITHUB_OUTPUT
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ secrets.DOCKERHUB_USERNAME }}/mc-webui:latest
|
|
${{ secrets.DOCKERHUB_USERNAME }}/mc-webui:${{ steps.get_tag.outputs.tag }}
|