-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: rewrite deploy action to be able to deploy multiple versions t…
…o gh pages
- Loading branch information
1 parent
446b6af
commit f5c03d4
Showing
3 changed files
with
56 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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,41 @@ | ||
name: Deploy docs to gh-pages | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- v8_maintenance | ||
- v9_maintenance | ||
workflow_dispatch: | ||
jobs: | ||
deploy-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: npm ci && npm run bootstrap | ||
- name: Set build directory and deployment path based on branch | ||
id: set-build-dir | ||
run: | | ||
echo "::set-output name=build_dir::./packages/__docs__/__build__" | ||
case "${{ github.ref }}" in | ||
"refs/heads/master") | ||
echo "::set-output name=deploy_dir::./" | ||
;; | ||
"refs/heads/v8_maintenance") | ||
echo "::set-output name=deploy_dir::v8" | ||
;; | ||
"refs/heads/v9_maintenance") | ||
echo "::set-output name=deploy_dir::v9" | ||
;; | ||
esac | ||
- name: Build docs-app | ||
run: npm run build:docs | ||
- name: Copy redirects config file to the __build__ directory. | ||
run: cp ./packages/__docs__/_redirects_gh_pages ./packages/__docs__/__build__ | ||
- name: Deploy to GitHub Pages | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: ${{ steps.set-build-dir.outputs.build_dir }} | ||
branch: gh-pages | ||
target-folder: ${{ steps.set-build-dir.outputs.deploy_dir }} | ||
clean-exclude: pr-preview | ||
force: false |
This file contains 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
This file contains 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