add ci for tg bot
Deploy app frontend / app frontend (push) Failing after 54s
Deploy service couchdb / service couchdb (push) Successful in 38s
Deploy db-migrations / db-migrations (push) Failing after 50s
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Failing after 1m27s
Deploy service tg-bot / service tg-bot (push) Failing after 44s
Deploy app frontend / app frontend (push) Failing after 54s
Deploy service couchdb / service couchdb (push) Successful in 38s
Deploy db-migrations / db-migrations (push) Failing after 50s
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Failing after 1m27s
Deploy service tg-bot / service tg-bot (push) Failing after 44s
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
name: Deploy service tg-bot
|
||||
run-name: ${{ github.actor }} deployed to build branch
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'services/tg-bot/**'
|
||||
- 'packages/couchdb-changes-stream/**'
|
||||
- '.gitea/workflows/deploy-service-tg-bot.yaml'
|
||||
- 'docker-compose.yml'
|
||||
- 'package.json'
|
||||
- 'pnpm-lock.yaml'
|
||||
|
||||
jobs:
|
||||
service tg-bot:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
COUCHDB_USER: ${{ secrets.COUCHDB_USER }}
|
||||
COUCHDB_PASSWORD: ${{ secrets.COUCHDB_PASSWORD }}
|
||||
VAPID_SUBJECT: ${{ vars.VAPID_SUBJECT }}
|
||||
GCM_API_KEY: ${{ vars.GCM_API_KEY }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
corepack enable pnpm && corepack use pnpm@8.15.9
|
||||
pnpm install --filter ./services/tg-bot
|
||||
|
||||
- name: build service
|
||||
run: |
|
||||
pnpm run --filter ./services/tg-bot build
|
||||
pnpm --filter ./services/tg-bot deploy --prod build/service-tg-bot
|
||||
|
||||
- name: build docker image
|
||||
run: MESSAGE_DELIVERY_METHOD_WEB_PUSH_TAG=commit-${{env.GITHUB_SHA}} docker compose -p hereconnect build tg-bot
|
||||
|
||||
- name: start container
|
||||
run: MESSAGE_DELIVERY_METHOD_WEB_PUSH_TAG=commit-${{env.GITHUB_SHA}} docker compose -p hereconnect up -d --pull never --wait tg-bot
|
||||
|
||||
- name: rename to latest
|
||||
run: docker tag hereconnect/service-tg-bot:commit-${{env.GITHUB_SHA}} hereconnect/service-tg-bot:latest
|
||||
|
||||
- name: rollback on failure
|
||||
if: failure()
|
||||
env:
|
||||
COUCHDB_TAG: latest
|
||||
run: docker compose -p hereconnect up -d --pull never --wait tg-bot
|
||||
|
||||
- name: cleanup docker image
|
||||
if: always()
|
||||
run: docker rmi hereconnect/service-tg-bot:commit-${{env.GITHUB_SHA}}
|
||||
Reference in New Issue
Block a user