Files
compor-academy/.github/workflows/ci.yml
Cauê Faleiros 7842a757cd
All checks were successful
CI / Validate frontend and API (push) Successful in 27s
CI / Build and publish Docker images (push) Successful in 44s
fix: use explicit Gitea registry credentials
2026-08-31 13:41:14 -03:00

42 lines
1.3 KiB
YAML

name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
packages: write
jobs:
validate:
name: Validate frontend and API
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci --include=dev
- run: npm run typecheck
- run: npm run build
publish-images:
name: Build and publish Docker images
needs: validate
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Sign in to the Gitea Container Registry
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.blyzer.com.br -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
- name: Build and publish API
run: |
docker build --pull -f Dockerfile.api -t gitea.blyzer.com.br/blyzer/compor-academy-api:latest .
docker push gitea.blyzer.com.br/blyzer/compor-academy-api:latest
- name: Build and publish web
run: |
docker build --pull -f Dockerfile.web -t gitea.blyzer.com.br/blyzer/compor-academy-web:latest .
docker push gitea.blyzer.com.br/blyzer/compor-academy-web:latest