Skip to content

Commit

Permalink
add pr testing for component explorer (microsoft#5365)
Browse files Browse the repository at this point in the history
* add component explorer pr testing

* remove autogenerated azure workflow

* update to correct download-artifact v2
  • Loading branch information
awentzel authored Nov 6, 2021
1 parent bfa5434 commit b122988
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 54 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/azure-static-web-apps-blue-coast-0df7a6610.yml

This file was deleted.

63 changes: 54 additions & 9 deletions .github/workflows/cd-explore-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- master

env:
AZURE_WEBAPP_ACTIVE_STAGE_NAME: explore-west-app
AZURE_WEBAPP_PASSIVE_STAGE_NAME: explore-east-app
AZURE_WEBAPP_BUILD_PATH: sites/fast-component-explorer
AZURE_WEBAPP_DIST_PATH: sites/fast-component-explorer/www
AZURE_WEBAPP_SLOT_NAME: stage
ARTIFACT_NAME: component-explorer-site

jobs:
build_deploy_linux:
build:
runs-on: ubuntu-latest

env:
AZURE_WEBAPP_ACTIVE_STAGE_NAME: explore-west-app
AZURE_WEBAPP_PASSIVE_STAGE_NAME: explore-east-app
AZURE_WEBAPP_BUILD_PATH: sites/fast-component-explorer
AZURE_WEBAPP_DIST_PATH: sites/fast-component-explorer/www
AZURE_WEBAPP_SLOT_NAME: stage

steps:
- name: Checkout Branch
uses: actions/checkout@master
Expand All @@ -35,6 +40,23 @@ jobs:
npm i
ls -lta
- uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.AZURE_WEBAPP_DIST_PATH }}

deploy_to_staging:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build

steps:
- name: Deploy PR
uses: actions/download-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.AZURE_WEBAPP_DIST_PATH }}

- name: 'Deploy to Active Azure Region'
uses: azure/webapps-deploy@v2
with:
Expand All @@ -51,9 +73,32 @@ jobs:
package: ${{ env.AZURE_WEBAPP_DIST_PATH }}
slot-name: ${{ env.AZURE_WEBAPP_SLOT_NAME }}

deploy_pr:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
needs: build

steps:
- name: Deploy PR
uses: actions/download-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.AZURE_WEBAPP_DIST_PATH }}

- name: Deploy Component Explorer
id: deploypr
uses: Azure/static-web-apps-deploy@v0.0.1-preview
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APP_EXPLORE_PR_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: 'upload'
app_location: ${{ env.AZURE_WEBAPP_DIST_PATH }}
output_location: ''
skip_app_build: true

notify:
runs-on: ubuntu-latest
needs: build_deploy_linux
needs: deploy_to_staging

steps:
- name: Notify on Discord
Expand Down

0 comments on commit b122988

Please sign in to comment.