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

34 lines
1.2 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: |
# Создаем контейнер-прокладку, который пробросит порт 5000 на Gitea.
# Docker разрешает пушить в localhost:5000 без SSL всегда.
docker run -d --name bridge --network host 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