This repository was archived by the owner on Jan 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.71 KB
/
staging.yml
File metadata and controls
49 lines (39 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# This is the workflow to manually deploy the bot to Google Cloud Functions
name: CI/CD Staging
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy:
# The job runs on windows
name: Deploy to Google Cloud Functions
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out the repository under $GITHUB_WORKSPACE
- name: Checkout code
uses: actions/checkout@v2
- name: Prepare SDK for further steps
uses: google-github-actions/setup-gcloud@v0.2.0
with:
project_id: ${{ secrets.PROJECT_ID_STA }}
service_account_key: ${{ secrets.GCLOUD_AUTH }}
export_default_credentials: true
- name: Activate Cloud Functions API
run: gcloud services enable cloudfunctions.googleapis.com
- name: Get Firebase credentials
run: gsutil cp gs://keystorage-${{ secrets.PROJECT_ID_STA }}/credentials.json credentials.json
- name: Deploy
uses: google-github-actions/deploy-cloud-functions@v0.1.2
with:
name: mbs_bench_bot
runtime: python37
env_vars: LOG_SEVERITY=$LOG_LEVEL, BOT_TOKEN=$BOT_TOKEN, BOT_NAME=$BOT_NAME, ERROR_CHAT_ID=$ERROR_CHAT_ID, GOOGLE_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS
region: europe-west1
env:
GOOGLE_APPLICATION_CREDENTIALS: "credentials.json"
BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_API_KEY_STA }}
BOT_NAME: "bench_bot_dev"
LOG_LEVEL: "DEBUG"
ERROR_CHAT_ID: ${{ secrets.ERROR_CHAT_ID }}