Files
Olhar-API/.gitea/workflows/ci.yml
T
Gato 9be3caa4ad
CI — Tests & Docker Build / Tests (push) Failing after 3s
CI — Tests & Docker Build / Build & push image Docker (push) Has been skipped
ci: remplace \$GITHUB_WORKSPACE par \$(pwd) pour le mount Docker
\$GITHUB_WORKSPACE n'est pas résolu dans le runner Gitea act.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 08:27:42 +02:00

69 lines
1.9 KiB
YAML

name: CI — Tests & Docker Build
on:
push:
branches:
- main
- 'feat/**'
pull_request:
jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lancer les tests
run: |
docker run --rm \
--network host \
-v $(pwd):/workspace \
-v /var/run/docker.sock:/var/run/docker.sock \
-e DOCKER_HOST=unix:///var/run/docker.sock \
-e TESTCONTAINERS_RYUK_DISABLED=true \
-w /workspace \
eclipse-temurin:25-jdk \
./gradlew test --no-daemon
build-and-push:
name: Build & push image Docker
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lire la version depuis build.gradle
id: version
run: echo "VERSION=$(grep '^version' build.gradle | awk -F"'" '{print $2}')" >> $GITHUB_OUTPUT
- name: Setup Buildx
uses: docker/setup-buildx-action@v3
- name: Login registry Gitea
uses: docker/login-action@v3
with:
registry: git.goutailler-olivier.com
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build & push image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
tags: |
git.goutailler-olivier.com/gato/olhar-api:latest
git.goutailler-olivier.com/gato/olhar-api:${{ steps.version.outputs.VERSION }}
- name: Trigger déploiement Watchtower
run: |
wget -q --post-data='' \
--header="Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" \
https://watchtower.goutailler-olivier.com/v1/update \
-O /dev/null