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

chore(test): use azure-login-action for deploying to staging/production #6946

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .github/workflows/cd-deploy-color-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ jobs:
needs: build

steps:
- name: 'Azure Login'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS_FAST_DESIGN }}

- name: Deploy PR
uses: actions/download-artifact@v2
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/cd-deploy-www-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ jobs:
needs: build

steps:
- name: 'Azure Login'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS_FAST_DESIGN }}

- uses: actions/download-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME }}
Expand Down
89 changes: 59 additions & 30 deletions .github/workflows/cd-deploy-www-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- master
- archives/fast-element-1
paths:
- '.github/workflows/cd-deploy-www-staging.yml'
- 'packages/utilities/fast-color/docs/api-report.md'
Expand All @@ -38,6 +38,10 @@ jobs:
- name: Checkout Branch
uses: actions/checkout@master

- uses: actions/setup-node@v3
with:
node-version: 16.20.0

- name: Install Lerna
run: yarn global add [email protected]

Expand All @@ -59,13 +63,18 @@ jobs:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.AZURE_WEBAPP_DIST_PATH }}

deploy_to_staging:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
deploy_active_region:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
needs: build

steps:
- name: Deploy PR
- name: 'Azure Login'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS_ACTIVE }}

- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME }}
Expand All @@ -74,48 +83,68 @@ jobs:
- name: 'Deploy to Active Azure Region'
uses: azure/webapps-deploy@v2
with:
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE_WWW_ACTIVE }}
app-name: ${{ env.AZURE_WEBAPP_ACTIVE_STAGE_NAME }}
package: ${{ env.AZURE_WEBAPP_DIST_PATH }}
slot-name: ${{ env.AZURE_WEBAPP_SLOT_NAME }}

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

steps:
- name: 'Azure Login'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS_PASSIVE }}

- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.AZURE_WEBAPP_DIST_PATH }}

- name: 'Deploy to Passive Azure Region'
uses: azure/webapps-deploy@v2
with:
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE_WWW_PASSIVE }}
app-name: ${{ env.AZURE_WEBAPP_PASSIVE_STAGE_NAME }}
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 Documentation
id: deploypr
uses: Azure/[email protected]
continue-on-error: ${{ (github.event_name == 'pull_request' && github.event.action != 'closed') }}
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APP_WWW_PR_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: 'upload'
app_location: ${{ env.AZURE_WEBAPP_DIST_PATH }}
output_location: ''
skip_app_build: true
# 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 Documentation
# id: deploypr
# uses: Azure/[email protected]
# continue-on-error: ${{ (github.event_name == 'pull_request' && github.event.action != 'closed') }}
# with:
# azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APP_WWW_PR_TOKEN }}
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# action: 'upload'
# app_location: ${{ env.AZURE_WEBAPP_DIST_PATH }}
# output_location: ''
# skip_app_build: true

destroy_pr:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest

steps:
- name: 'Azure Login'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS_FAST_DESIGN }}

- name: Destroy PR
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
Expand All @@ -125,7 +154,7 @@ jobs:

notify:
runs-on: ubuntu-latest
needs: deploy_to_staging
needs: [deploy_active_region, deploy_passive_region]

steps:
- name: Notify on Discord
Expand Down
1 change: 0 additions & 1 deletion sites/fast-website/src/public/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<%= require("svg/icon-brand.svg") %> <%=
require("svg/icon-brand-fast.svg") %>
</fast-anchor>
<site-navigation-item href="https://explore.fast.design">Components</site-navigation-item>
<site-navigation-item href="/docs/introduction">Documentation</site-navigation-item>
<site-navigation-item href="https://discord.gg/FcSNfg4">Community</site-navigation-item>
<fast-anchor
Expand Down
9 changes: 9 additions & 0 deletions sites/website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ html[data-theme='dark'] .DocSearch-Hit[aria-selected="true"] a mark {
--ifm-menu-color-background-active: transparent;
}

.breadcrumbs__link,
.menu__list-item-collapsible--active {
background: transparent !important;
}

.docusaurus-highlight-code-line {
background-color: #212121;
display: block;
Expand All @@ -91,3 +96,7 @@ html[data-theme='dark'] .DocSearch-Hit[aria-selected="true"] a mark {
background: var(--ifm-color-primary);
color: var(--ifm-color-secondary);
}

.navbar__item.navbar__link.navbar__link--active {
color: var(--ifm-heading-color);
}
Loading