Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pr testing for color explorer #5366

Merged
merged 3 commits into from
Nov 6, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .github/workflows/azure-static-web-apps-purple-ocean-0b7ce3410.yml

This file was deleted.

63 changes: 54 additions & 9 deletions .github/workflows/cd-color-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: color-west-app
AZURE_WEBAPP_PASSIVE_STAGE_NAME: color-east-app
AZURE_WEBAPP_BUILD_PATH: sites/fast-color-explorer
AZURE_WEBAPP_DIST_PATH: sites/fast-color-explorer/www
AZURE_WEBAPP_SLOT_NAME: stage
ARTIFACT_NAME: color-explorer-site

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

env:
AZURE_WEBAPP_ACTIVE_STAGE_NAME: color-west-app
AZURE_WEBAPP_PASSIVE_STAGE_NAME: color-east-app
AZURE_WEBAPP_BUILD_PATH: sites/fast-color-explorer
AZURE_WEBAPP_DIST_PATH: sites/fast-color-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_COLOR_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