ts6-botflow/.gitea/workflows/container.yaml
Bxio febc807ad9
All checks were successful
Testar e publicar imagem Docker / publish (push) Successful in 15s
Reapply "Add Gitea image publishing workflow and Portainer runner stacks"
This reverts commit 282ba08c818b057c65bb06849383fb3fc855aed8.
2026-10-10 18:50:15 +01:00

45 lines
1.5 KiB
YAML

name: Testar e publicar imagem Docker
on:
push:
branches: [main]
workflow_dispatch:
jobs:
publish:
runs-on: botflow-docker
env:
IMAGE: gitea.zol.oixb.run/oixb.run/ts6-botflow
steps:
- name: Preparar ferramentas
run: apk add --no-cache git nodejs ca-certificates
- name: Obter codigo
uses: https://github.com/actions/checkout@v4
with:
persist-credentials: false
- name: Testar autenticacao
run: docker build --target test -t ts6-botflow-tests:${{ gitea.sha }} .
- name: Construir imagem
run: |
docker build --pull --target runtime \
--label org.opencontainers.image.source=https://gitea.zol.oixb.run/oixb.run/ts6-botflow \
--label org.opencontainers.image.revision=${{ gitea.sha }} \
-t "$IMAGE:${{ gitea.sha }}" -t "$IMAGE:latest" .
- name: Publicar no registry Gitea
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -eu
test -n "$REGISTRY_USER" || { echo 'Falta o secret REGISTRY_USER'; exit 1; }
test -n "$REGISTRY_TOKEN" || { echo 'Falta o secret REGISTRY_TOKEN'; exit 1; }
export DOCKER_CONFIG="$(mktemp -d)"
trap 'rm -rf "$DOCKER_CONFIG"' EXIT
printf '%s' "$REGISTRY_TOKEN" | docker login gitea.zol.oixb.run -u "$REGISTRY_USER" --password-stdin
docker push "$IMAGE:${{ gitea.sha }}"
docker push "$IMAGE:latest"