-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix status page and add staging workflow (#309)
- Loading branch information
Showing
4 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
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
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: . |
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
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> |
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
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