Monday Website Push To Production #150
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: Monday Website Push To Production | |
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 | |
with: | |
# Fetch the full history, to build attribution.json | |
fetch-depth: 0 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "13.x" | |
cache: yarn | |
- uses: microsoft/playwright-github-action@v1 | |
# Builds the modules, and boostraps the other modules | |
- name: Build website | |
run: | | |
yarn install | |
yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1 | |
yarn bootstrap | |
yarn workspace typescriptlang-org setup-playground-cache-bust | |
yarn build | |
env: | |
YARN_CHECKSUM_BEHAVIOR: ignore | |
# Builds the site | |
- name: Makes the site | |
run: | | |
yarn build-site | |
cp -r packages/typescriptlang-org/public site | |
env: | |
YARN_CHECKSUM_BEHAVIOR: ignore | |
# Deploy to the prod appservice | |
- name: Deploy + Publish to AppService | |
uses: peaceiris/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PUBLISH_BRANCH: "SITE-PRODUCTION" | |
PUBLISH_DIR: ./site | |
- name: Build And Deploy | |
id: builddeploy | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROD }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
action: "upload" | |
app_location: "site" | |
skip_app_build: true | |
# Update the site stats | |
- run: node packages/typescriptlang-org/scripts/updateAppInsightsGitHubIssue.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }} | |
APP_INSIGHTS_API_KEY: ${{ secrets.APP_INSIGHTS_API_KEY }} | |
APP_INSIGHTS_ID: ${{ secrets.APP_INSIGHTS_ID }} | |
- name: Send a message to Microsoft Teams | |
if: ${{ failure() }} | |
uses: aliencube/[email protected] | |
with: | |
webhook_uri: ${{ secrets.TEAMS_WEB_BOT_INCOMING_URL }} | |
title: Prod deploy failed | |
summary: Could not build the site for production | |
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" }] }]' |