Add Boston TypeScript Club meetup (#3065) #1315
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: Build Website To Staging | |
on: | |
push: | |
branches: [v2] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Check out, and set up the node/ruby infra | |
- uses: actions/checkout@v2 | |
with: | |
# Fetch the full history, to build attribution.json | |
fetch-depth: 0 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "16.x" | |
registry-url: "https://registry.npmjs.org/" | |
cache: yarn | |
# For Azure uploads | |
- run: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash | |
- name: Prepare website v2 | |
run: | | |
yarn install | |
yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1 | |
yarn bootstrap | |
yarn workspace typescriptlang-org setup-playground-cache-bust | |
yarn workspace typescriptlang-org setup-staging | |
yarn build | |
env: | |
YARN_CHECKSUM_BEHAVIOR: ignore | |
- name: Build website v2 | |
run: | | |
yarn build-site | |
cp -r packages/typescriptlang-org/public site | |
- name: Deploy + Publish to CDN | |
# You can find these keys here: | |
# https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/57bfeeed-c34a-4ffd-a06b-ccff27ac91b8/resourcegroups/typescriptlang-org/providers/Microsoft.Storage/storageAccounts/typescriptorgstaging/keys | |
env: | |
AZURE_STORAGE_ACCOUNT: "typescriptorgstaging" | |
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CDN_STAGING_CONNECTION_STRING }} | |
run: az storage blob upload-batch --overwrite -s ./site -d \$web | |
- 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_NICE_MEADOW_0C9756810 }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
action: "upload" | |
app_location: "site" | |
skip_app_build: true | |
# Deploy | |
- name: Deploy npm Packages | |
run: | | |
yarn pleb publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
- name: Send a message to Microsoft Teams | |
if: ${{ failure() }} | |
uses: aliencube/[email protected] | |
with: | |
webhook_uri: ${{ secrets.TEAMS_WEB_BOT_INCOMING_URL }} | |
title: Staging deploy failed | |
summary: Could not build the site for staging | |
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" }] }]' |