Skip to content

Commit

Permalink
add telegram_bot_service/tests/test_bot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
terapevt1981 committed Nov 8, 2024
1 parent 9650617 commit d99ced4
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/gcp-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy to Google Cloud Run

on:
push:
branches: [ main ]
paths:
- 'telegram_bot_service/**'
- '.github/workflows/gcp-deploy.yml'

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
export_default_credentials: true

- name: Authorize Docker
run: gcloud auth configure-docker

- name: Build Docker Image
run: |
docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/telegram-bot-service:${{ github.sha }} ./telegram_bot_service
- name: Push to Container Registry
run: |
docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/telegram-bot-service:${{ github.sha }}
- name: Deploy to Cloud Run
run: |
gcloud run deploy telegram-bot-service \
--image gcr.io/${{ secrets.GCP_PROJECT_ID }}/telegram-bot-service:${{ github.sha }} \
--platform managed \
--region ${{ secrets.GCP_REGION }} \
--allow-unauthenticated \
--set-env-vars TELEGRAM_BOT_TOKEN=${{ secrets.TELEGRAM_BOT_TOKEN }}
3 changes: 3 additions & 0 deletions telegram_bot_service/tests/test_bot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# telegram_bot_service/tests/test_bot.py
def test_placeholder():
assert True

0 comments on commit d99ced4

Please sign in to comment.