Files
polymarket-bot/.gitea/workflows/ci.yml
T
chemavx 9bdafaa51e
CI/CD / build-and-push (push) Successful in 2m24s
feat: add dashboard source code with Vite + React + Recharts and CI/CD build
- Reconstruct dashboard from compiled container: App.jsx, main.jsx, index.css
- nginx.conf with SPA routing and /api proxy to api:8000
- Multi-stage Dockerfile: node:20-alpine build + nginx:alpine serve
- Add third kaniko build step in ci.yml for chemavx/polymarket-bot-dashboard
- Update k8s manifest sed to patch deployment-dashboard.yaml image on each push

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 17:18:32 +00:00

86 lines
2.9 KiB
YAML

name: CI/CD
on:
push:
branches:
- main
env:
REGISTRY: git.chemavx.xyz
K8S_MANIFESTS_REPO: http://chemavx:${{ secrets.CI_TOKEN }}@gitea.gitea.svc.cluster.local:3000/chemavx/k8s-manifests.git
GIT_SSL_NO_VERIFY: "true"
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ssl-verify: false
- name: Set image tag
id: tag
run: echo "TAG=${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
- name: Build and push bot image
uses: aevea/action-kaniko@master
with:
registry: git.chemavx.xyz
username: chemavx
password: ${{ secrets.CI_TOKEN }}
image: chemavx/polymarket-bot
tag: ${{ steps.tag.outputs.TAG }}
path: .
build_file: Dockerfile
extra_args: --insecure --skip-tls-verify
- name: Build and push API image
uses: aevea/action-kaniko@master
with:
registry: git.chemavx.xyz
username: chemavx
password: ${{ secrets.CI_TOKEN }}
image: chemavx/polymarket-bot-api
tag: ${{ steps.tag.outputs.TAG }}
path: .
build_file: Dockerfile.api
extra_args: --insecure --skip-tls-verify
- name: Build and push dashboard image
uses: aevea/action-kaniko@master
with:
registry: git.chemavx.xyz
username: chemavx
password: ${{ secrets.CI_TOKEN }}
image: chemavx/polymarket-bot-dashboard
tag: ${{ steps.tag.outputs.TAG }}
path: dashboard
build_file: Dockerfile
extra_args: --insecure --skip-tls-verify
- name: Update k8s manifests
run: |
TAG=${{ steps.tag.outputs.TAG }}
git config --global user.email "ci@git.chemavx.xyz"
git config --global user.name "Gitea CI"
git clone ${{ env.K8S_MANIFESTS_REPO }} /tmp/k8s-manifests
cd /tmp/k8s-manifests
sed -i "s|image: .*polymarket-bot[^-].*|image: git.chemavx.xyz/chemavx/polymarket-bot:${TAG}|g" \
polymarket-bot/deployment-bot.yaml
sed -i "s|image: .*polymarket-bot-api.*|image: git.chemavx.xyz/chemavx/polymarket-bot-api:${TAG}|g" \
polymarket-bot/deployment-api.yaml
sed -i "s|image: .*polymarket-bot-dashboard.*|image: git.chemavx.xyz/chemavx/polymarket-bot-dashboard:${TAG}|g" \
polymarket-bot/deployment-dashboard.yaml
sed -i "s|imagePullPolicy: Never|imagePullPolicy: Always|g" \
polymarket-bot/deployment-bot.yaml \
polymarket-bot/deployment-api.yaml \
polymarket-bot/deployment-dashboard.yaml
git add polymarket-bot/deployment-bot.yaml polymarket-bot/deployment-api.yaml polymarket-bot/deployment-dashboard.yaml
git diff --cached --quiet || git commit -m "ci: update polymarket-bot images to ${TAG} [skip ci]"
git push