Files
dance-lessons-coach/.gitea/workflows/dockerimage.yaml
Gabriel Radureau 7c6075e836
Some checks failed
Go CI/CD Pipeline / Lint and Format (push) Failing after 1m45s
Go CI/CD Pipeline / Arcodange Workflow Validation (push) Failing after 5m39s
Go CI/CD Pipeline / Build and Test (push) Failing after 7m9s
Go CI/CD Pipeline / Version Management (push) Has been skipped
🤖 feat: simplify CI/CD structure and add Docker workflow
- Rename ci-cd.yaml to go-ci-cd.yaml for clarity
- Add dockerimage.yaml workflow for Docker builds
- Create Dockerfile for production deployment
- Add comprehensive CI/CD documentation
- Create contributor-quickstart.sh for easy validation
- Update all scripts to handle both workflow files
- Fix event triggers to run on all relevant pushes
- Remove redundant YAML syntax validation
- Improve workflow validation for Arcodange conventions

BREAKING CHANGE: ci-cd.yaml renamed to go-ci-cd.yaml
See scripts/cicd/README.md for complete documentation.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-06 11:02:36 +02:00

84 lines
2.7 KiB
YAML

---
# DanceLessonsCoach Docker Image Build Workflow
# Based on Arcodange webapp conventions
# Builds and publishes Docker images to Gitea Container Registry
name: Docker Build and Publish
on:
workflow_dispatch: {}
push:
branches:
- main
tags:
- 'v*.*.*'
paths-ignore:
- 'README.md'
- 'doc/**'
- 'adr/**'
- '.gitea/**'
# cancel any previously-started, yet still active runs of this workflow on the same branch
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
# Arcodange-specific environment variables
env:
GITEA_INTERNAL: "https://gitea.arcodange.lab/"
GITEA_EXTERNAL: "https://gitea.arcodange.fr/"
GITEA_ORG: "arcodange"
GITEA_REPO: "DanceLessonsCoach"
CI_REGISTRY: "gitea.arcodange.lab"
jobs:
build-and-push-image:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.CI_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PACKAGES_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push image to Gitea Container Registry
run: |-
# Determine tags based on event type
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
# For tags, use the tag name and latest
TAGS="${{ github.ref_name }} latest"
else
# For main branch, use commit SHA and latest
TAGS="latest ${{ github.sha }}"
fi
echo "Building Docker image with tags: $TAGS"
docker build -t dance-lessons-coach .
for TAG in $TAGS; do
IMAGE_NAME="${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:$TAG"
echo "Tagging and pushing: $IMAGE_NAME"
docker tag dance-lessons-coach "$IMAGE_NAME"
docker push "$IMAGE_NAME"
done
- name: Show published images
run: |-
echo "📦 Published Docker images:"
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:${{ github.ref_name }}"
echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:latest"
else
echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:latest"
echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:${{ github.sha }}"
fi