Files
max-telegram-bridge-bot/.gitea/workflows/deploy.yml
T
2026-05-27 16:11:13 +09:00

46 lines
1.1 KiB
YAML

name: Build and Deploy
run-name: Deploy ${{ gitea.ref_name }}
on:
push:
branches: [main]
tags: ['v*']
jobs:
build-and-deploy:
name: Build, Test & Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Vet
run: go vet ./...
- name: Test
run: go test ./...
- name: Build binary
run: CGO_ENABLED=1 go build -o max-telegram-bridge-bot .
- name: Build Docker image
run: docker build -t max-telegram-bridge-bot:latest .
- name: Create .env file from secrets
run: |
echo "TG_TOKEN=${{ secrets.TG_TOKEN }}" > .env
echo "MAX_TOKEN=${{ secrets.MAX_TOKEN }}" >> .env
echo "TG_API_URL=${{ secrets.TG_API_URL }}" >> .env
- name: Deploy with Docker Compose
run: docker compose up -d
- name: Health check
run: |
echo "Waiting for container to start..."
sleep 10
docker ps --filter "name=bridge" --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"