add action to deploy cloud function

This commit is contained in:
olemorud
2022-12-07 18:39:33 +01:00
parent 990d3aa426
commit d4889c4e3e

33
.github/workflows/deploy.yml vendored Normal file
View 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'