name: Deploy Cloud Funcstions
on:
workflow_dispatch:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: 'actions/checkout@v3'
- id: 'auth'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- id: 'deploy'
uses: 'google-github-actions/deploy-cloud-functions@v0'
with:
name: 'test-function'
runtime: 'python38'
region: 'asia-northeast1'
source_dir: 'app'
entry_point: 'main'
event_trigger_type: 'providers/cloud.pubsub/eventTypes/topic.publish'
event_trigger_resource: 'projects/my-project/topics/test-topic'
on:
workflow_dispatch:
push:
branches: [ master ]
- id: 'auth'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- id: 'deploy'
uses: 'google-github-actions/deploy-cloud-functions@v0'
with:
name: 'test-function'
runtime: 'python38'
region: 'asia-northeast1'
source_dir: 'app'
entry_point: 'main'
event_trigger_type: 'providers/cloud.pubsub/eventTypes/topic.publish'
event_trigger_resource: 'projects/my-project/topics/test-topic'
パラメータ | 説明 |
---|---|
name | デプロイする関数名 |
runtime | 関数を実行する環境 |
region | 関数を実行するリージョン |
source_dir | ソースのディレクトリ。ここで指定したディレクトリ配下がデプロイされる |
entry_point | 実行する関数名 |
event_trigger_type | トリガーのタイプ。デフォルトはhttpだが今回はtopicを設定 |
event_trigger_resource | トピックの名前 |