mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* build up redirects for API docs hosting * build with all features and documenting config * fix warnings * can rustdoc please provide a way to modify the base url? I want to host the docs at /next/:crate_name, not at /:crate_name ffs * Don't clean URLs... what is rustdoc doing? * now it wants to work??? * build a next index page * unreleased docs banner * show coverage * remove ./ ??? * try 2? * api-docs/ not api-docs-public/ * please
71 lines
2.3 KiB
YAML
71 lines
2.3 KiB
YAML
name: Publish API Docs
|
|
on:
|
|
workflow_run:
|
|
workflows: ["Build API Docs (Rustdoc)"]
|
|
types:
|
|
- completed
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
PR_INFO_FILE: ".PR_INFO"
|
|
steps:
|
|
- if: github.event.workflow_run.conclusion != 'success'
|
|
name: Abort if build failed
|
|
run: |
|
|
echo "build failed"
|
|
exit 1
|
|
|
|
# need to checkout to get "firebase.json", ".firebaserc"
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Download build artifact
|
|
uses: dawidd6/action-download-artifact@v2
|
|
with:
|
|
github_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
workflow: build-api-docs.yml
|
|
run_id: ${{ github.event.workflow_run.id }}
|
|
name: api-docs
|
|
path: api-docs/
|
|
|
|
- if: github.event.workflow_run.event == 'pull_request'
|
|
name: Download pr info
|
|
uses: dawidd6/action-download-artifact@v2
|
|
with:
|
|
github_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
workflow: build-api-docs.yml
|
|
run_id: ${{ github.event.workflow_run.id }}
|
|
name: pr-info
|
|
|
|
- if: github.event.workflow_run.event == 'pull_request'
|
|
name: Apply pull request environment
|
|
run: |
|
|
pr_number=$(cat "$PR_INFO_FILE")
|
|
if ! [[ "$pr_number" =~ ^[0-9]+$ ]]; then
|
|
echo "pr number invalid"
|
|
exit 1
|
|
fi
|
|
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
|
|
echo "PR_BRANCH=${{ github.event.workflow_run.head_branch }}" >> $GITHUB_ENV
|
|
echo "COMMIT_SHA=${{ github.event.workflow_run.head_sha }}" >> $GITHUB_ENV
|
|
|
|
- if: github.event.workflow_run.event == 'push'
|
|
name: Apply push environment
|
|
run: |
|
|
echo "CHANNEL_ID=live" >> $GITHUB_ENV
|
|
|
|
- name: Deploy to Firebase
|
|
uses: siku2/action-hosting-deploy@v1
|
|
with:
|
|
repoToken: "${{ secrets.GITHUB_TOKEN }}"
|
|
firebaseToken: "${{ secrets.FIREBASE_TOKEN }}"
|
|
targets: api
|
|
channelId: "${{ env.CHANNEL_ID }}"
|
|
# link to the next version because that's what we care about
|
|
commentURLPath: "/next/yew"
|
|
# PR information
|
|
prNumber: "${{ env.PR_NUMBER }}"
|
|
prBranchName: "${{ env.PR_BRANCH }}"
|
|
commitSHA: "${{ env.COMMIT_SHA }}"
|