Skip to content

Update main.yml

Update main.yml #22

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Deploy to Google Cloud Functions
# Controls when the action will run.
on:
# Triggers the workflow on push event for the main branch
push:
branches: [ main ]
# 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:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Ready for deployment
run: echo Ready for deployment
- name: Setup GCloud
uses: google-github-actions/setup-gcloud@main
with:
project_id: ${{ secrets.GCP_PROJ_NAME }}
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
export_default_credentials: true
- name: Deploy Cloud Functions
uses: google-github-actions/deploy-cloud-functions@main
with:
# Name of the Cloud Function.
name: insert_data
# Description for the Cloud Function.
description: test-description
# Region to deploy the function in. Defaults to us-central1, if not specified.
region: us-central1
# Name of a function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified.
entry_point: insert_data
# Runtime to use for the function.
runtime: python38
env_vars_file: .github/env/env.yaml
event_trigger_type: providers/cloud.pubsub/eventTypes/topic.publish
event_trigger_resource: projects/${{ secrets.GCP_PROJ_NAME }}/topics/trigger-github-actions-deploy-gf
# Runs a single command using the runners shell
- name: Deployment has completed
run: echo Deployment has completed