Release Webhook #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Webhook | |
on: | |
workflow_run: | |
workflows: ["Build and test"] | |
branches: [main] | |
types: | |
- completed | |
permissions: | |
contents: read | |
actions: read | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: arnested/go-version-action@v1 | |
id: version | |
with: | |
working-directory: webhook | |
- run: echo ::set-output name=go-runtime::$(echo -n go${{ steps.version.outputs.go-mod-version }} | tr -d '.') | |
id: runtime | |
- uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: '${{ secrets.GCLOUD_AUTH }}' | |
- uses: google-github-actions/deploy-cloud-functions@v2 | |
with: | |
source_dir: ./webhook/ | |
name: ${{ secrets.CF_NAME }} | |
region: ${{ secrets.CF_REGION }} | |
project_id: ${{ secrets.CF_PROJECT }} | |
runtime: ${{ steps.runtime.outputs.go-runtime }} | |
entry_point: "Handle" | |
env_vars: GITHUB_SECRET=${{ secrets.SHARED_SECRET }},GITHUB_TEAM_SLUG=${{ secrets.TEAM_SLUG }},NOTIFY=${{ secrets.NOTIFY }},TZ=Europe/Copenhagen | |
description: ${{ github.repository }} | |
https_trigger_security_level: secure_always | |
memory_mb: 128 | |
- name: Post status to Zulip | |
if: ${{ always() }} | |
uses: containrrr/shoutrrr-action@v1 | |
with: | |
url: "${{ secrets.ZULIP_SHOUTRRR_URL }}?stream=logs&topic=reviewbot" | |
message: "Deployed `${{ github.repository }}`@`${{ github.sha }}` to Google Cloud Function `${{ secrets.CF_NAME }}`@`${{ secrets.CF_PROJECT }}`: **${{ job.status }}**." |