Adicionado pacotes de extensões datatables #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compilar, testar e buildar | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Buildar, testar e gerar imagem | |
services: | |
aproove-db-test: | |
image: postgres:16 | |
env: | |
POSTGRES_DB: aproove-dbname | |
POSTGRES_USER: aproove-dbuser | |
POSTGRES_PASSWORD: aproove-dbpasswd | |
ports: | |
- 5433:5432 | |
steps: | |
- name: Checkout do projeto | |
uses: actions/checkout@v3 | |
- name: Usar Node 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Instalar pacotes do frontend | |
run: npm --prefix ./frontend install | |
- name: Buildar frontend | |
run: npm --prefix ./frontend run build --omit=dev -- "-c=production" | |
- name: Usar JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
cache: 'maven' | |
- name: Definir settings.xml | |
uses: s4u/maven-settings-action@v2.8.0 | |
with: | |
servers: | | |
[{ | |
"id": "github-apcode", | |
"username": "${{ github.actor }}", | |
"password": "${{ secrets.GITHUB_TOKEN }}" | |
}] | |
- name: Compilar e testar backend | |
run: mvn -B clean package --file backend/pom.xml | |
- name: Buscar versão atual | |
run: echo "VERSAO=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file backend/pom.xml)" >> $GITHUB_ENV | |
- name: Logar no registry do github | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build da imagem docker | |
run: docker build -f .docker/Dockerfile.pipeline -t ghcr.io/andrepenteado/aproove/roove:latest -t ghcr.io/andrepenteado/aproove/roove:${{ env.VERSAO }} . | |
- name: Push da imagem docker | |
run: | | |
docker push ghcr.io/andrepenteado/aproove/roove:latest | |
docker push ghcr.io/andrepenteado/aproove/roove:${{ env.VERSAO }} |