ts6-botflow/.gitea/workflows/container.yaml
Bxio 0458606410
Some checks failed
Testar e publicar imagem Docker / publish (push) Has been cancelled
Add Gitea image publishing workflow and Portainer runner stacks
2026-10-10 18:40:08 +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"