Some checks failed
- 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>
84 lines
2.7 KiB
YAML
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
|