Files
claudia-docs-api/.gitea/workflows/ci.yml
Motoko b4440ffe8f
Some checks failed
CI / test (push) Failing after 1m33s
CI / build (push) Has been skipped
feat: Build and push Docker images to Gitea registry
2026-03-31 04:54:44 +00:00

68 lines
1.6 KiB
YAML

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
REGISTRY: gitea.danielarroyo.cl
IMAGE_NAME: claudia-docs-api
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install pytest pytest-asyncio aiosqlite
- name: Run tests
run: pytest tests/ -v --tb=short
build:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.GITEA_USER }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=ref,event=branch
type=sha,prefix={{branch}}-
type=raw,value=latest
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: ./claudia-docs-api
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}