Files
tg-bot-template/.gitea/workflows/deploy.yml
Yuu Ottosoka 71365836d3 feat: add bot and api services with config, logger and database packages
- Add bot service with telegram integration and webhook/polling modes
- Add api service with hono, swagger and zod-openapi
- Create config package for environment variable management
- Create logger package for colored console logging
- Create database package with prisma integration
- Remove next.js web and docs apps
- Update turbo.json for new services
- Add dockerfiles and gitea workflows for deployment
2025-07-08 19:46:08 +03:00

102 lines
3.1 KiB
YAML

name: release-tag
on:
push:
branches:
- main
jobs:
build-and-deploy-bot:
env:
DOCKER_LATEST: latest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Get Meta
id: meta
run: |
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
echo REPO_VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_OUTPUT
- name: Log in to Docker registry
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push bot
uses: docker/build-push-action@v5
with:
context: .
file: ./apps/bot/Dockerfile
push: true
tags: |
${{ vars.DOCKER_REGISTRY }}/${{ steps.meta.outputs.REPO_NAME }}-bot:${{ steps.meta.outputs.REPO_VERSION }}
${{ vars.DOCKER_REGISTRY }}/${{ steps.meta.outputs.REPO_NAME }}-bot:${{ env.DOCKER_LATEST }}
- name: Trigger Dokploy Bot Deployment
run: |
curl -X 'POST' \
'https://${{ vars.DOKPLOY_DOMAIN }}/api/trpc/application.deploy' \
-H 'accept: application/json' \
-H 'x-api-key:${{ secrets.DOKPLOY_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{
"json":{
"applicationId": "${{ vars.DOKPLOY_BOT_APPLICATION_ID }}"
}
}'
build-and-deploy-api:
env:
DOCKER_LATEST: latest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Get Meta
id: meta
run: |
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
echo REPO_VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_OUTPUT
- name: Log in to Docker registry
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push api
uses: docker/build-push-action@v5
with:
context: .
file: ./apps/api/Dockerfile
push: true
tags: |
${{ vars.DOCKER_REGISTRY }}/${{ steps.meta.outputs.REPO_NAME }}-api:${{ steps.meta.outputs.REPO_VERSION }}
${{ vars.DOCKER_REGISTRY }}/${{ steps.meta.outputs.REPO_NAME }}-api:${{ env.DOCKER_LATEST }}
- name: Trigger Dokploy API Deployment
run: |
curl -X 'POST' \
'https://${{ vars.DOKPLOY_DOMAIN }}/api/trpc/application.deploy' \
-H 'accept: application/json' \
-H 'x-api-key:${{ secrets.DOKPLOY_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{
"json":{
"applicationId": "${{ vars.DOKPLOY_API_APPLICATION_ID }}"
}
}'