Skip to content

Commit

Permalink
Fix status page and add staging workflow (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
rezrah authored Jun 4, 2022
1 parent b295252 commit 86ffbdd
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 1 deletion.
57 changes: 57 additions & 0 deletions .github/workflows/deploy_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and deploy staging

on:
push:
branches:
- staging

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: '14.x'

- name: install and build
run: |
yarn
yarn build
- name: Copy rewrites to server root
run: |
cp web.config public/
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: node-app
path: ./public/

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'staging'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v2
with:
name: node-app

- name: Deploy to Azure Web App service
uses: azure/webapps-deploy@v2
id: deploy-to-webapp
with:
app-name: 'primerstyle'
slot-name: 'staging'
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE_STAGING }}
package: .
14 changes: 14 additions & 0 deletions applicationHost.xdt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<proxy xdt:Transform="InsertIfMissing" enabled="true" preserveHostHeader="false" reverseRewriteHostInResponseHeaders="false"/>
<rewrite xdt:Transform="InsertIfMissing">
<allowedServerVariables xdt:Transform="InsertIfMissing">
<add name="HTTP_X_ORIGINAL_HOST" xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)"/>
<add name="HTTP_X_UNPROXIED_URL" xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)"/>
<add name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)"/>
<add name="HTTP_ACCEPT_ENCODING" xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)"/>
</allowedServerVariables>
</rewrite>
</system.webServer>
</configuration>
2 changes: 1 addition & 1 deletion src/pages/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function StatusPage() {
<Text as="p" fontSize={3} color="blue.2">
Status of components in the Primer Design System.
<br />
Check out the
Check out the{' '}
<LinkLight href="https://primer.style/contribute/component-lifecycle">component lifecycle</LinkLight> for
more information about each status.
</Text>
Expand Down
4 changes: 4 additions & 0 deletions web.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" />
</staticContent>
<httpErrors errorMode="Custom" existingResponse="Auto" defaultResponseMode="ExecuteURL" >
<remove statusCode="404"/>
<error statusCode="404" responseMode="ExecuteURL" path="/404/index.html" />
Expand Down

0 comments on commit 86ffbdd

Please sign in to comment.