34 lines
874 B
YAML
34 lines
874 B
YAML
|
|
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'
|
|
|