forked from isar/isar
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* "vx.x" to be replaced in deployment * Deployment to github pages * Fix repo links
- Loading branch information
1 parent
3fb3795
commit 32d1411
Showing
2 changed files
with
53 additions
and
25 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 |
---|---|---|
@@ -1,40 +1,67 @@ | ||
name: Docs | ||
name: Unified Deploy Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
- v3 | ||
|
||
jobs: | ||
build_docs: | ||
name: Build and deploy Docs | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
permissions: | ||
contents: write | ||
id-token: write | ||
pages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build | ||
working-directory: docs | ||
- name: Checkout v3 branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: "v3" | ||
path: "v3" | ||
|
||
- name: Build v3 docs | ||
run: | | ||
cd v3/docs | ||
sed -i'.bak' "s|base:.*|base: '/v3/',|" docs/.vuepress/config.ts | ||
sed -i 's|text: "vx.x"|text: "v3.x"|' docs/.vuepress/config.ts | ||
npm ci | ||
npm run build | ||
mv ./docs/.vuepress/dist ../../v3-docs | ||
- name: Checkout main branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: "main" | ||
path: "main" | ||
|
||
- name: Build main docs | ||
run: | | ||
npm install | ||
cd main/docs | ||
sed -i'.bak' "s|base:.*|base: '/',|" docs/.vuepress/config.ts | ||
sed -i 's|text: "vx.x"|text: "v4.x"|' docs/.vuepress/config.ts | ||
npm ci | ||
npm run build | ||
touch docs/.vuepress/dist/.nojekyll | ||
mv ./docs/.vuepress/dist ../../main-docs | ||
- name: Prepare deployment directory | ||
run: | | ||
mkdir deploy | ||
mv main-docs/* deploy/ | ||
mkdir deploy/v3 | ||
mv v3-docs/* deploy/v3/ | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v2 | ||
uses: actions/configure-pages@v4 | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: docs/docs/.vuepress/dist | ||
path: deploy | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 | ||
uses: actions/deploy-pages@v4 |
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