Problem: Commitdd063d5modified docker-compose*.yml files but did NOT trigger Gitea Actions build because docker-compose files were not in the workflow's paths trigger list. Evidence: - git show --statdd063d5shows only docker-compose*.yml and docs/ changed - .gitea/workflows/docker-publish.yaml paths did not include docker-compose*.yml - Gitea Actions did not run after push (verified by user) Solution: Added 'docker-compose*.yml' to workflow paths trigger list. Justification: Docker-compose files are deployment configuration that should trigger image rebuilds when changed. This ensures Dokploy applications always pull images with the latest docker-compose configurations. Testing: This commit will trigger a build because it modifies .gitea/workflows/** (which is in the paths list). Future docker-compose changes will also trigger.
62 lines
1.5 KiB
YAML
62 lines
1.5 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
- staging
|
|
- main
|
|
paths:
|
|
- 'src/**'
|
|
- 'client/**'
|
|
- 'Dockerfile'
|
|
- 'docker-compose*.yml'
|
|
- 'package.json'
|
|
- '.gitea/workflows/**'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
REGISTRY: git.app.flexinit.nl
|
|
IMAGE_NAME: oussamadouhou/ai-stack-deployer
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: oussamadouhou
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
tags: |
|
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
|
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' }}
|
|
type=raw,value=staging,enable=${{ github.ref == 'refs/heads/staging' }}
|
|
type=sha,prefix={{branch}}-
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|