Files
play-life/.gitea/workflows/build-and-push.yml
poignatov bad68160f4
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 10s
Update workflow configuration
2025-12-30 19:58:22 +03:00

36 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Local Bridge
run: |
# Принудительно удаляем старый контейнер, если он завис
docker rm -f bridge || true
# Запускаем туннель с флагом --rm для автоматической очистки
docker run -d --name bridge --network host --rm alpine sh -c "apk add socat && socat TCP-LISTEN:5000,fork,reuseaddr TCP:172.17.0.6:3000"
sleep 2
- name: Log in to Gitea Registry
run: |
# Логинимся в localhost. Это ОБЯЗАНО сработать без ошибки HTTPS.
echo "${{ secrets.GIT_TOKEN }}" | docker login localhost:5000 -u ${{ secrets.GIT_USERNAME }} --password-stdin
- name: Build and Push
run: |
# Собираем образ с тегом localhost
docker build -t localhost:5000/poignatov/play-life:latest .
# Пушим через наш мостик
docker push localhost:5000/poignatov/play-life:latest