From 0d0f43cfa815ad8e220e7df397063e46311653b9 Mon Sep 17 00:00:00 2001 From: Hiro Date: Tue, 31 Mar 2026 04:54:51 +0000 Subject: [PATCH] feat: Build and push Docker images to Gitea registry --- .gitea/workflows/ci.yml | 51 ++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d9a122b..d25e046 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ main ] +env: + REGISTRY: gitea.danielarroyo.cl + IMAGE_NAME: claudia-docs-web + jobs: test: runs-on: ubuntu-latest @@ -29,34 +33,39 @@ jobs: run: | cd frontend npm run type-check || npm run build -- --noEmit - - - name: Run linter - run: | - cd frontend - npm run lint || true 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 Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - cache-dependency-path: frontend/package-lock.json + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Build - run: | - cd frontend - npm ci - npm run build - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 + - name: Login to Gitea Registry + uses: docker/login-action@v3 with: - name: dist - path: frontend/dist + 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-web + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}