Push AI stats to Teams #99
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: Push AI stats to Teams | |
on: | |
schedule: | |
# https://crontab.guru/#0_12_*_*_1 | |
- cron: "0 12 * * 1" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "16.x" | |
cache: yarn | |
# Build v2 | |
- name: Deps | |
run: | | |
yarn install | |
env: | |
YARN_CHECKSUM_BEHAVIOR: ignore | |
# Update the site stats | |
- run: node packages/typescriptlang-org/scripts/pingTeamsWithAppInsightData.js | |
env: | |
APP_INSIGHTS_API_KEY: ${{ secrets.APP_INSIGHTS_API_KEY }} | |
APP_INSIGHTS_ID: ${{ secrets.APP_INSIGHTS_ID }} | |
STATS_WEBHOOK_INCOMING_URL: ${{ secrets.STATS_WEBHOOK_INCOMING_URL }} | |
- name: Send a message to Microsoft Teams | |
if: ${{ failure() }} | |
uses: aliencube/[email protected] | |
with: | |
webhook_uri: ${{ secrets.TEAMS_WEB_BOT_INCOMING_URL }} | |
title: Updating site stats failed | |
summary: Something failed in the GitHub Action workflow | |
actions: '[{ "@type": "OpenUri", "name": "View Logs", "targets": [{ "os": "default", "uri": "https://github.com/microsoft/TypeScript-Website/actions/runs/${{ github.run_id }}?check_suite_focus=true" }] }]' |