Files
docker-monica/.gitea/workflows/dev.yaml
Workflow config file is invalid. Please check your config file: yaml: line 58: could not find expected ':'
2025-10-25 21:23:49 +02:00

59 lines
1.8 KiB
YAML

name: docker-monica-build development
on:
push:
branches-ignore:
- main # Läuft auf allen Branches außer `main`
jobs:
dockerfile_lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
build:
needs: dockerfile_lint
runs-on: ubuntu-22.04
env:
DOCKER_HOST: tcp://localhost:2375 # unverschlüsselte Verbindung
steps:
- uses: actions/checkout@v4
- name: Clean Branch Name
id: clean_branch_name
run: |
CLEANED_BRANCH_NAME=$(echo "${GITHUB_REF_NAME}" | tr '[:upper:]' '[:lower:]' | tr '/_' '-')
echo "CLEAN_BRANCH_NAME=${CLEANED_BRANCH_NAME}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: host=tcp://localhost:2375 # Verbindung ohne TLS
- name: Log in to registry
uses: docker/login-action@v2
with:
registry: gitea.sikorski.cloud
username: rogersik
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image with Buildx
env:
DOCKER_HOST: tcp://localhost:2375
run: |
# create builder instance
docker buildx create --name mybuilder --use || true
docker buildx inspect --bootstrap
# build and push
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag gitea.sikorski.cloud/rogersik/monica:${{ env.CLEAN_BRANCH_NAME }} \
--cache-from=type=registry,ref=gitea.sikorski.cloud/rogersik/monica:cache \
--cache-to=type=registry,ref=gitea.sikorski.cloud/rogersik/monica:cache,mode=max \
--push \
.