forked from citkane/typedoc-plugin-versions
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
68 additions
and
68 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,84 +1,84 @@ | ||
name: Publish Docs | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
workflow_dispatch: | ||
workflow_call: | ||
permissions: | ||
contents: write # allows the 'Commit' step without tokens | ||
contents: write # allows the 'Commit' step without tokens | ||
|
||
jobs: | ||
get_history: # create an artifact from the existing documentation builds | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: get the gh-pages repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: gh-pages | ||
get_history: # create an artifact from the existing documentation builds | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: get the gh-pages repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: gh-pages | ||
|
||
- name: tar the existing docs | ||
run: | | ||
mkdir -p ./docs | ||
tar -cvf documentation.tar ./docs | ||
- name: tar the existing docs | ||
run: | | ||
mkdir -p ./docs | ||
tar -cvf documentation.tar ./docs | ||
- name: create a document artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: documentation | ||
path: documentation.tar | ||
- name: create a document artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: documentation | ||
path: documentation.tar | ||
|
||
build: # builds the distribution and then the documentation | ||
needs: get_history | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout src | ||
uses: actions/checkout@v4 | ||
build: # builds the distribution and then the documentation | ||
needs: get_history | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout src | ||
uses: actions/checkout@v4 | ||
|
||
- run: mkdir -p ./docs | ||
- name: Download the existing documents artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: documentation | ||
- run: tar -xf documentation.tar ./docs -C ./docs | ||
- run: mkdir -p ./docs | ||
- name: Download the existing documents artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: documentation | ||
- run: tar -xf documentation.tar ./docs -C ./docs | ||
|
||
- name: Build | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
cache: npm | ||
- run: npm i | ||
- run: npm run build # set up 'build' script in your package.json | ||
- name: Build | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
cache: npm | ||
- run: npm i | ||
- run: npm run build # set up 'build' script in your package.json | ||
|
||
- name: Build documents | ||
run: npm run build:docs #set up 'build:docs' build script in your package.json | ||
- name: Build documents | ||
run: npm run build:docs #set up 'build:docs' build script in your package.json | ||
|
||
- name: tar the new docs | ||
run: tar -cvf newdocumentation.tar ./docs | ||
- name: tar the new docs | ||
run: tar -cvf newdocumentation.tar ./docs | ||
|
||
- name: create a new document artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: newdocumentation | ||
path: newdocumentation.tar | ||
- name: create a new document artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: newdocumentation | ||
path: newdocumentation.tar | ||
|
||
commit: # commit the old and new merged documents to gh-pages/docs | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout the gh-pages repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: gh-pages | ||
commit: # commit the old and new merged documents to gh-pages/docs | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout the gh-pages repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: gh-pages | ||
|
||
- run: mkdir -p ./docs | ||
- name: Download the new documents artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: newdocumentation | ||
- run: tar -xf newdocumentation.tar ./docs -C ./docs | ||
- run: mkdir -p ./docs | ||
- name: Download the new documents artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: newdocumentation | ||
- run: tar -xf newdocumentation.tar ./docs -C ./docs | ||
|
||
- name: commit | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Continuous Integration" | ||
git add . | ||
git commit -m "CI updated the documentation" | ||
git push | ||
- name: commit | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Continuous Integration" | ||
git add . | ||
git commit -m "CI updated the documentation" | ||
git push |