feat: Build and push Docker images to Gitea registry
Some checks failed
CI / test (push) Failing after 45s
CI / build (push) Has been skipped

This commit is contained in:
Hiro
2026-03-31 04:54:51 +00:00
parent 3a313abef4
commit 0d0f43cfa8

View File

@@ -6,6 +6,10 @@ on:
pull_request: pull_request:
branches: [ main ] branches: [ main ]
env:
REGISTRY: gitea.danielarroyo.cl
IMAGE_NAME: claudia-docs-web
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -30,33 +34,38 @@ jobs:
cd frontend cd frontend
npm run type-check || npm run build -- --noEmit npm run type-check || npm run build -- --noEmit
- name: Run linter
run: |
cd frontend
npm run lint || true
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: test needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Node.js - name: Set up Docker Buildx
uses: actions/setup-node@v4 uses: docker/setup-buildx-action@v3
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Build - name: Login to Gitea Registry
run: | uses: docker/login-action@v3
cd frontend
npm ci
npm run build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with: with:
name: dist registry: ${{ env.REGISTRY }}
path: frontend/dist 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 }}