Files
compor-academy/.github/workflows/ci.yml
Cauê Faleiros 7a18251916
Some checks failed
CI / Validate frontend and API (push) Successful in 29s
CI / Build and publish Docker images (push) Failing after 5s
feat: publish Swarm images to Gitea registry
2026-08-31 13:35:53 -03:00

42 lines
1.2 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.GITEA_TOKEN }}" | docker login gitea.blyzer.com.br -u "${{ gitea.actor }}" --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