diff --git a/.github/workflows/DeployStaging.yml b/.github/workflows/DeployStaging.yml new file mode 100644 index 000000000000..ed8592e8d944 --- /dev/null +++ b/.github/workflows/DeployStaging.yml @@ -0,0 +1,39 @@ +name: Build Website To Staging + +on: + push: + branches: [v2] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Check out, and set up the node/ruby infra + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '13.x' + + # Build v2 + - name: Build website v2 + run: | + yarn install + yarn bootstrap + yarn build + yarn build-site + + # Move the files to the new app + - run: rm -rf serve/public + - name: Move V2 public to serve dir + run: cp packages/typescriptlang-org/public serve + + - name: Build serve server + run: | + cd serve + npm i + + # Deploy _just_ the serve server + - uses: azure/webapps-deploy@v1 + with: + creds: ${{ secrets.AZURE_STAGING_PUBLISHING_PROFILE }} diff --git a/package.json b/package.json index aab346d6be8f..1bc91881d2d0 100644 --- a/package.json +++ b/package.json @@ -40,5 +40,8 @@ "semi": false, "singleQuote": true, "trailingComma": "es5" + }, + "dependencies": { + "serve-handler": "^6.1.2" } } diff --git a/serve/README.md b/serve/README.md new file mode 100644 index 000000000000..41cb5476d617 --- /dev/null +++ b/serve/README.md @@ -0,0 +1,5 @@ +## Azure App + +For an App Service App we need an app to host our static content. + +Here is one, it doesn't do much but hosts files inside the public directory. diff --git a/serve/index.js b/serve/index.js new file mode 100644 index 000000000000..e3b97379adae --- /dev/null +++ b/serve/index.js @@ -0,0 +1,13 @@ +const handler = require('serve-handler') +const http = require('http') + +const server = http.createServer((request, response) => { + // You pass two more arguments for config and middleware + // More details here: https://github.com/zeit/serve-handler#options + return handler(request, response, { public: 'public' }) +}) + +const port = process.env.PORT || 3000 +server.listen(port, () => { + console.log('Running at http://localhost:' + port) +}) diff --git a/serve/package-lock.json b/serve/package-lock.json new file mode 100644 index 000000000000..f71914f8f90b --- /dev/null +++ b/serve/package-lock.json @@ -0,0 +1,99 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "fast-url-parser": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz", + "integrity": "sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0=", + "requires": { + "punycode": "^1.3.2" + } + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "requires": { + "mime-db": "~1.33.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" + }, + "path-to-regexp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz", + "integrity": "sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "serve-handler": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.2.tgz", + "integrity": "sha512-RFh49wX7zJmmOVDcIjiDSJnMH+ItQEvyuYLYuDBVoA/xmQSCuj+uRmk1cmBB5QQlI3qOiWKp6p4DUGY+Z5AB2A==", + "requires": { + "bytes": "3.0.0", + "content-disposition": "0.5.2", + "fast-url-parser": "1.1.3", + "mime-types": "2.1.18", + "minimatch": "3.0.4", + "path-is-inside": "1.0.2", + "path-to-regexp": "2.2.1", + "range-parser": "1.2.0" + } + } + } +} diff --git a/serve/package.json b/serve/package.json new file mode 100644 index 000000000000..46589ef056db --- /dev/null +++ b/serve/package.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "start": "node index.js" + }, + "dependencies": { + "serve-handler": "^6.1.2" + } +} diff --git a/serve/public/index.html b/serve/public/index.html new file mode 100644 index 000000000000..e9951c8a65d4 --- /dev/null +++ b/serve/public/index.html @@ -0,0 +1,3 @@ + +

This is a blank file which is overwritten during a deploy

+