Skip to content
Merged
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
73 changes: 73 additions & 0 deletions .github/workflows/docsite-publish-ghpages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Workflow name
name: 'Docsite publish'

on:
push:
branches:
- master
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
if: ${{ contains(github.event.head_commit.message, 'applying package updates') || github.event_name == 'workflow_dispatch' }}

outputs:
status: ${{ steps.verify-react-components-changed.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch' }}

steps:
- uses: actions/checkout@v3
name: Checkout [master]

- name: Verify react-compoenents has changed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to force this job to run even if components haven't changed? How do I push new docs, or simply a typo fix into the website?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a manual trigger option for this. You can always trigger manual deployments because of this condition: ${{ steps.verify-react-components-changed.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch' }}

uses: tj-actions/[email protected]
id: verify-react-components-changed
with:
files: |
packages/react-components/react-components/package.json
build:
runs-on: ubuntu-latest
needs: check
if: needs.check.outputs.status == 'true'

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 14.18.1
cache: 'yarn'

- name: Install packages
run: yarn install --frozen-lockfile

- name: Build dependencies
run: yarn build --to @fluentui/public-docsite-v9

- name: Build storybook
run: yarn workspace @fluentui/public-docsite-v9 build-storybook

- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v1
with:
path: './apps/public-docsite-v9/dist/storybook/'
deploy:
runs-on: ubuntu-latest
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
9 changes: 0 additions & 9 deletions .github/workflows/docsite-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ on:
branches:
- master
workflow_dispatch:
# both inputs are required by chromaui/action
# https://github.com/chromaui/action#triggering-from-workflow_dispatch
inputs:
sha:
description: The SHA-1 hash referring to the commit which will be used for publishing.
required: true
ref:
description: The head branch associated with the pull request.
required: true

jobs:
check:
Expand Down