Files
omnex/.gitea/workflows/ci-api.yml
T
Nuxgrid 6ff6333781
ci-web / test (push) Has been cancelled
ci-web / publish (push) Has been cancelled
ci-api / test (push) Failing after 26m55s
ci-api / publish (push) Failing after 14m58s
chore: dispatch ci
2026-07-27 16:48:41 +02:00

68 lines
1.5 KiB
YAML

name: ci-api
# CI pour control-plane/api (Go) : build, vet, tests, puis publication de l'image
# Docker sur push vers main.
on:
push:
branches: [main]
paths:
- "control-plane/api/**"
- ".gitea/workflows/ci-api.yml"
pull_request:
paths:
- "control-plane/api/**"
- ".gitea/workflows/ci-api.yml"
workflow_dispatch: {}
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: control-plane/api
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.26.0"
cache-dependency-path: control-plane/api/go.sum
- name: Vet
run: go vet ./...
- name: Build
run: go build ./...
- name: Test
run: go test ./...
publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & push api
uses: docker/build-push-action@v6
with:
context: ./control-plane/api
file: ./control-plane/api/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/omnex-api:latest