Files
mattermost-coffee-ping/.github/workflows/deploy.yml
2022-12-07 19:18:49 +01:00

37 lines
990 B
YAML

name: 'Deploy Google Cloud Function'
on: workflow_dispatch
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: 'Checkout'
uses: 'actions/checkout@v3'
- name: 'Google Cloud Authentication'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: ${{ secrets.CLOUD_CREDENTIALS }}
- name: 'Deploy Cloud Function'
uses: 'google-github-actions/deploy-cloud-functions@v1'
with:
name: 'Coffee'
entry_point: Coffee
source_dir: '/cmd'
description: 'Ping selected group of members on mattermost when coffee is mentioned'
env_vars: 'MATTERMOST_TOKEN=${{ secrets.MATTERMOST_TOKEN }},TEST_TOKEN=${{ secrets.TEST_TOKEN }}'
runtime: 'go119'
memory_mb: 128
region: 'europe-west1'
- name: 'Test #1'
run: 'echo "This curl should fail (no token)"; "curl" "${{ steps.deploy.outputs.url }}" || true'