ci: simplificar pipeline para build local sem tokens (paridade com EduManager)
Build and Deploy (Gitea Actions) / build-and-deploy (push) Waiting to run
Details
Build and Deploy (Gitea Actions) / build-and-deploy (push) Waiting to run
Details
This commit is contained in:
parent
bbfd76c9d9
commit
c7722c010c
|
|
@ -6,46 +6,23 @@ on:
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-deploy:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Build App
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Log in to Gitea Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: gitea.microtecinformaticacurso.com.br
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push App
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
platforms: linux/arm64
|
|
||||||
tags: gitea.microtecinformaticacurso.com.br/${{ github.repository }}/agendapro-app:latest
|
|
||||||
|
|
||||||
- name: Build and push Admin
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: ./admin
|
|
||||||
push: true
|
|
||||||
platforms: linux/arm64
|
|
||||||
tags: gitea.microtecinformaticacurso.com.br/${{ github.repository }}/agendapro-admin:latest
|
|
||||||
|
|
||||||
- name: Atualizar Containers em Produção (Watchtower)
|
|
||||||
run: |
|
run: |
|
||||||
AUTH=$(echo -n "${{ github.actor }}:${{ secrets.GITEA_TOKEN }}" | base64 -w 0)
|
docker build --no-cache -t agendapro-app:local .
|
||||||
echo "{\"auths\": {\"gitea.microtecinformaticacurso.com.br\": {\"auth\": \"$AUTH\"}}}" > $(pwd)/registry-config.json
|
|
||||||
|
|
||||||
docker run --rm \
|
- name: Build Admin
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
run: |
|
||||||
-v $(pwd)/registry-config.json:/config.json \
|
cd admin
|
||||||
containrrr/watchtower \
|
docker build --no-cache -t agendapro-admin:local .
|
||||||
--run-once --cleanup --debug
|
|
||||||
|
- name: Deploy to Portainer
|
||||||
|
run: |
|
||||||
|
docker service update --force --image agendapro-app:local agendapro_agendapro || echo "App ainda não existe, será criado pelo stack deploy inicial."
|
||||||
|
docker service update --force --image agendapro-admin:local agendapro_admin-agendapro || echo "Admin ainda não existe, será criado pelo stack deploy inicial."
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ services:
|
||||||
# AGENDAPRO APP — Sistema Principal
|
# AGENDAPRO APP — Sistema Principal
|
||||||
# =============================================================
|
# =============================================================
|
||||||
agendapro:
|
agendapro:
|
||||||
image: gitea.microtecinformaticacurso.com.br/sidney/agendapro/agendapro-app:latest
|
image: agendapro-app:local
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres-agendapro
|
- postgres-agendapro
|
||||||
|
|
@ -53,7 +53,7 @@ services:
|
||||||
# ADMIN PANEL — Gerenciador de Assinaturas
|
# ADMIN PANEL — Gerenciador de Assinaturas
|
||||||
# =============================================================
|
# =============================================================
|
||||||
admin-agendapro:
|
admin-agendapro:
|
||||||
image: gitea.microtecinformaticacurso.com.br/sidney/agendapro/agendapro-admin:latest
|
image: agendapro-admin:local
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres-agendapro
|
- postgres-agendapro
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue