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

39 lines
1.4 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
# Пробрасываем localhost:8080 раннера на Gitea:3000
docker run -d --name bridge --network host --rm alpine sh -c "apk add socat && socat TCP-LISTEN:8080,fork,reuseaddr TCP:172.17.0.6:3000"
sleep 3
- name: Log in to Gitea Registry
# Docker ВСЕГДА разрешает HTTP для localhost.
run: |
echo "${{ secrets.GIT_TOKEN }}" | docker login localhost:8080 -u ${{ secrets.GIT_USERNAME }} --password-stdin
- name: Build and Push
run: |
# Собираем образ с тегом localhost:8080
docker build -t localhost:8080/poignatov/play-life:latest .
# Пушим через туннель
docker push localhost:8080/poignatov/play-life:latest
# Добавляем тег с SHA коммита для истории
docker tag localhost:8080/poignatov/play-life:latest localhost:8080/poignatov/play-life:${{ github.sha }}
docker push localhost:8080/poignatov/play-life:${{ github.sha }}