add action to deploy cloud function
This commit is contained in:
33
.github/workflows/deploy.yml
vendored
Normal file
33
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
name: 'Deploy Google Cloud Function'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
permissions:
|
||||||
|
contents: 'read'
|
||||||
|
id-token: 'write'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- id: 'Checkout'
|
||||||
|
uses: 'actions/checkout@v3'
|
||||||
|
|
||||||
|
- id: 'Google Cloud Authentication'
|
||||||
|
uses: 'google-github-actions/auth@v1'
|
||||||
|
with:
|
||||||
|
credentials_json: ${{ secrets.CLOUD_CREDENTIALS }}
|
||||||
|
|
||||||
|
- id: 'Deploy Cloud Function'
|
||||||
|
uses: 'google-github-actions/deploy-cloud-functions@v1'
|
||||||
|
with:
|
||||||
|
description: 'Ping selected group of members on mattermost when coffee is mentioned'
|
||||||
|
name: 'coffee2'
|
||||||
|
runtime: 'go119'
|
||||||
|
memory_mb: 1
|
||||||
|
region: 'europe-west1'
|
||||||
|
|
||||||
|
- id: 'Test #1'
|
||||||
|
run: 'echo "This should fail (no token)"; "curl "${{ steps.deploy.outputs.url }}" || true'
|
||||||
|
|
||||||
|
- id: 'Test #2'
|
||||||
|
run: 'echo "This should succeed"; "curl "${{ steps.deploy.outputs.url }}" || true'
|
||||||
|
|
||||||
Reference in New Issue
Block a user