-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(cicd): update docsite publish workflow to publish to github pages #24846
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,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 | ||
| 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 | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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' }}