Skip to content

Commit c37f1c6

Browse files
Move preview to new deployment, pin dependencies, misc cleanup (#3091)
Co-authored-by: navya9singh <[email protected]>
1 parent eaa8205 commit c37f1c6

25 files changed

+103
-201
lines changed

.github/dependabot.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: 'github-actions'
9+
directory: '/'
10+
schedule:
11+
interval: 'weekly'
12+
groups:
13+
github-actions:
14+
patterns:
15+
- '*'

.github/workflows/CI.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
# Check out, and set up the node/ruby infra
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-node@v2
12+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
13+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
1414
with:
1515
node-version: "18.x"
1616

@@ -32,7 +32,7 @@ jobs:
3232
# Verify it compiles
3333
- run: yarn build-site
3434

35-
- uses: actions/upload-artifact@v4
35+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
3636
if: github.event_name == 'pull_request'
3737
with:
3838
name: site
@@ -74,8 +74,8 @@ jobs:
7474

7575
steps:
7676
# Check out, and set up the node infra
77-
- uses: actions/checkout@v2
78-
- uses: actions/setup-node@v2
77+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
78+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
7979
with:
8080
node-version: "18.x"
8181

.github/workflows/close-preview.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
steps:
1616
- uses: Azure/static-web-apps-deploy@v1
1717
with:
18-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROD }}
18+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PREVIEW }}
1919
action: close
2020
app_location: /dev/null

.github/workflows/deploy-preview.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
steps:
2525
- name: Get PR/workflow run info
2626
id: get-info
27-
uses: actions/github-script@v7
27+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
2828
with:
2929
script: |
3030
let pr;
@@ -104,7 +104,7 @@ jobs:
104104
105105
- name: Download site build from PR
106106
if: ${{ steps.get-info.outputs.result != 'null' }}
107-
uses: actions/download-artifact@v4
107+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
108108
with:
109109
name: site
110110
path: site
@@ -116,7 +116,7 @@ jobs:
116116
if: ${{ steps.get-info.outputs.result != 'null' }}
117117
uses: Azure/static-web-apps-deploy@v1
118118
with:
119-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROD }}
119+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PREVIEW }}
120120
repo_token: ${{ secrets.GITHUB_TOKEN }}
121121
action: "upload"
122122
app_location: "site"
@@ -127,7 +127,7 @@ jobs:
127127
- name: Comment on PR
128128
# azure/static-web-apps-deploy seems to comment itself when the event is pull_request_target
129129
if: ${{ steps.get-info.outputs.result != 'null' && github.event_name != 'pull_request_target' }}
130-
uses: actions/github-script@v7
130+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
131131
env:
132132
PR_NUMBER: ${{ fromJson(steps.get-info.outputs.result).pr }}
133133
SITE_URL: ${{ steps.deploy.outputs.static_web_app_url }}

.github/workflows/deploy-prod-static.yml

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to Azure Static Web Apps
1+
name: Deploy to GitHub Pages
22

33
on:
44
push:
@@ -26,11 +26,11 @@ jobs:
2626
runs-on: ubuntu-latest
2727

2828
steps:
29-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
3030
with:
3131
# Fetch the full history, to build attribution.json
3232
fetch-depth: 0
33-
- uses: actions/setup-node@v2
33+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
3434
with:
3535
node-version: "18.x"
3636
cache: yarn
@@ -53,16 +53,6 @@ jobs:
5353
env:
5454
YARN_CHECKSUM_BEHAVIOR: ignore
5555

56-
- name: Deploy
57-
id: builddeploy
58-
uses: Azure/static-web-apps-deploy@v1
59-
with:
60-
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROD }}
61-
repo_token: ${{ secrets.GITHUB_TOKEN }}
62-
action: "upload"
63-
app_location: "site"
64-
skip_app_build: true
65-
6656
- name: Setup Pages
6757
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
6858

@@ -80,4 +70,4 @@ jobs:
8070
steps:
8171
- name: Deploy to GitHub Pages
8272
id: deployment
83-
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
73+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4

.github/workflows/keepalive.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
contents: write
1212

1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
1515
- run: |
1616
if [[ $(git log --format="%H" --since "50 days" | head -c1 | wc -c) == 0 ]]; then
1717
git config user.email "[email protected]"
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish packages
2+
3+
on:
4+
push:
5+
branches: [v2]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# Check out, and set up the node/ruby infra
14+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
15+
with:
16+
# Fetch the full history, to build attribution.json
17+
fetch-depth: 0
18+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
19+
with:
20+
node-version: "18.x"
21+
registry-url: "https://registry.npmjs.org/"
22+
cache: yarn
23+
24+
- name: Prepare website v2
25+
run: |
26+
yarn install
27+
yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1
28+
yarn bootstrap
29+
yarn workspace typescriptlang-org setup-playground-cache-bust
30+
yarn build
31+
env:
32+
YARN_CHECKSUM_BEHAVIOR: ignore
33+
34+
- name: Build website v2
35+
run: |
36+
yarn build-site
37+
cp -r packages/typescriptlang-org/public site
38+
39+
# Deploy
40+
- name: Deploy npm Packages
41+
run: |
42+
yarn pleb publish
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

.github/workflows/update_teams.yml

-62
This file was deleted.

.github/workflows/v2-merged-staging.yml

-75
This file was deleted.

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,9 @@ packages/sandbox/src/release_data.ts
8080
packages/typescriptlang-org/src/lib/documentationNavigation.ts
8181

8282
.idea/
83+
84+
**/.vscode/*
85+
!**/.vscode/tasks.json
86+
!**/.vscode/settings.template.json
87+
!**/.vscode/launch.json
88+
!**/.vscode/extensions.json

.vscode/settings.json .vscode/settings.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"**/packages/typescriptlang-org/.cache/*": true
66
},
77
"typescript.tsdk": "node_modules/typescript/lib",
8-
"deno.enable": false,
8+
"deno.enable": false
99
}

README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
### Meta
22

3-
- **URLs:** [production](https://www.typescriptlang.org), [staging](http://www.staging-typescript.org/)
4-
- **Admin:** Prod: [Azure Portal](https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/99160d5b-9289-4b66-8074-ed268e739e8e/resourceGroups/Default-Web-WestUS/providers/Microsoft.Web/sites/TypeScript-1ebb3390-2634-4956-a955-eab987b7bb25/appServices), [Deploy logs](https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/99160d5b-9289-4b66-8074-ed268e739e8e/resourceGroups/Default-Web-WestUS/providers/Microsoft.Web/sites/TypeScript-1ebb3390-2634-4956-a955-eab987b7bb25/vstscd)
3+
- **URLs:** [production](https://www.typescriptlang.org)
54
- **Translations:** [microsoft/TypeScript-Website-Localizations](https://github.com/microsoft/TypeScript-Website-Localizations)
65

76
### Getting Started
@@ -33,8 +32,6 @@ Some useful knowledge you need to know:
3332
- All packages have: `yarn build` and `yarn test`
3433
- All packages use [debug](https://www.npmjs.com/package/debug) - which means you can do `env DEBUG="*" yarn test` to get verbose logs
3534

36-
You can manually via GH Actions for [production here](https://github.com/microsoft/TypeScript-Website/actions?query=workflow%3A%22Monday+Website+Push+To+Production%22) and [staging here](https://github.com/microsoft/TypeScript-Website/actions?query=workflow%3A%22Build+Website+To+Staging%22).
37-
3835
Having issues getting set up? [Consult the troubleshooting](./docs/Setup%20Troubleshooting.md).
3936

4037
## Deployment
@@ -102,7 +99,7 @@ yarn workspace tsconfig-reference run lint resolveJson
10299

103100
## Documentation
104101

105-
The docs for TypeScript. Originally ported over from [microsoft/TypeScript-Handbook](https://github.com/microsoft/TypeScript-Handbook/) then intermingled with [microsoft/TypeScript-New-Handbook](https://github.com/microsoft/TypeScript-New-Handbook), and finally updated for [Twoslash](http://www.staging-typescript.org/dev/twoslash/) and with new content.
102+
The docs for TypeScript. Originally ported over from [microsoft/TypeScript-Handbook](https://github.com/microsoft/TypeScript-Handbook/) then intermingled with [microsoft/TypeScript-New-Handbook](https://github.com/microsoft/TypeScript-New-Handbook).
106103

107104
## JSON Schema
108105

docs/Converting Twoslash Code Samples.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ x = [10, "hello"];
6565

6666
---
6767

68-
A twoslash code sample can do _a lot_ - the best documentation for twoslash lives inside the [bug workbench](https://www.staging-typescript.org/dev/bug-workbench) where you can test your code sample live and read how it all works.
68+
A twoslash code sample can do _a lot_ - the best documentation for twoslash lives inside the [bug workbench](https://www.typescriptlang.org/dev/bug-workbench) where you can test your code sample live and read how it all works.

docs/Something Went Wrong.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ We're currently running on App Service, the places where you can find info:
2020

2121
The build to deploy train normally looks like this:
2222

23-
- `v2` branch gets pushed:
24-
- A deploy is made to azure blob storage via [`.github/workflows/v2-merged-staging.yml`](https://github.com/microsoft/TypeScript-website/blob/v2/.github/workflows/v2-merged-staging.yml)
25-
- Every Monday, a deploy is made from v2 to the production app via [`.github/workflows/deploy-prod.yml`](https://github.com/microsoft/TypeScript-website/blob/v2/.github/workflows/deploy-prod.yml)
23+
- `v2` branch gets pushed
24+
- The website is deployed to GitHub pages
2625

27-
You can deploy `v2` to production anytime via the ["Run workflow" button here](https://github.com/microsoft/TypeScript-Website/actions?query=workflow%3A%22Monday+Website+Push+To+Production%22), so if you have an emergency commit - it goes to `v2` then you can run the action.
26+
You can deploy `v2` to production anytime via the ["Run workflow" button here](https://github.com/microsoft/TypeScript-Website/actions/workflows/deploy-prod-static.yml), so if you have an emergency commit - it goes to `v2` then you can run the action.
2827

2928
App Service apps are configured by [`Web.config`](https://github.com/microsoft/TypeScript-website/blob/v2/packages/typescriptlang-org/static/Web.config). [Here's a reference on the format](https://hangouts.google.com/call/H553wrJ9d97l2LMpNh9hAEEE). I've seen files (`*.json` & `*.manifest`) be 404s on the site because they were not in the config.
3029

packages/create-typescript-playground-plugin/template/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ Once you're happy and it's polished, you can apply to have it in the default plu
6363

6464
## Support
6565

66-
Ask questions either on the TypeScript Website issues](https://github.com/microsoft/TypeScript-Website/issues), or in the [TypeScript Community Discord](https://discord.gg/typescript) - in the TypeScript Website channel.
66+
Ask questions either on the [TypeScript Website issues](https://github.com/microsoft/TypeScript-Website/issues), or in the [TypeScript Community Discord](https://discord.gg/typescript) - in the TypeScript Website channel.

0 commit comments

Comments
 (0)