games_app/.gitea/workflows/ci.yml
Your Name 5ce6a6811a
Some checks failed
CI / test-and-build (push) Failing after 25s
Add Gitea CI/CD stack, tloto-deploy, and tagged Compose images
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-17 19:56:39 +02:00

59 lines
2.0 KiB
YAML

# CI only — never deploys production.
name: CI
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Backend install + compile
working-directory: backend
run: npm ci && npm run build
- name: Set image tag
id: meta
run: |
SHA="${GITHUB_SHA:-}"
if [ -z "$SHA" ]; then SHA="$(git rev-parse HEAD)"; fi
echo "sha=${SHA:0:12}" >> "$GITHUB_OUTPUT"
echo "full=$SHA" >> "$GITHUB_OUTPUT"
- name: Build backend image
run: |
docker build -t 127.0.0.1:5000/tloto-backend:${{ steps.meta.outputs.sha }} ./backend
docker tag 127.0.0.1:5000/tloto-backend:${{ steps.meta.outputs.sha }} 127.0.0.1:5000/tloto-backend:sha-${{ steps.meta.outputs.sha }}
- name: Build web image
run: |
docker build \
--build-arg VITE_API_BASE_URL=http://127.0.0.1:9080 \
--build-arg VITE_WS_URL=ws://127.0.0.1:9080/ws/v1/games/candle-predict \
--build-arg VITE_WS_ENABLED=true \
-t 127.0.0.1:5000/tloto-web:${{ steps.meta.outputs.sha }} \
./prediqo_web
- name: Push images to local registry
run: |
# Host registry published on 127.0.0.1:5000; from job container use gateway.
# act_runner with docker.sock builds on host daemon — 127.0.0.1:5000 works.
docker push 127.0.0.1:5000/tloto-backend:${{ steps.meta.outputs.sha }}
docker push 127.0.0.1:5000/tloto-web:${{ steps.meta.outputs.sha }}
- name: Record artifact markers
run: |
mkdir -p .ci-out
echo "${{ steps.meta.outputs.full }}" > .ci-out/sha.txt
echo "CI_OK ${{ steps.meta.outputs.sha }}"