Deploy Documents #1263
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
name: "Deploy Documents" | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
container: | |
image: tizendotnet/tizenfx-build-worker:2.2 | |
options: --ulimit nofile=10240:10240 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: TizenAPI/TizenFX-Docs | |
- name: Checkout TizenFX sources | |
run: | | |
rm -rf /usr/share/docfx | |
rm -rf /usr/bin/docfx | |
dotnet tool install -g docfx --version 2.61.0 | |
export PATH="$PATH:/home/jenkins/.dotnet/tools" | |
./build_all.sh clone | |
- name: Cache DocFX output | |
id: cache-site | |
uses: actions/cache@v2 | |
with: | |
path: _site | |
key: docfx-gh-pages-site-${{ hashFiles('repos/commits') }} | |
- name: Build Documents | |
if: steps.cache-site.outputs.cache-hit != 'true' | |
run: | | |
cp docfx_config/docfx.json docfx.json | |
./build_all.sh restore | |
./build_all.sh build | |
./build_all.sh index | |
- name: Archive Artifacts | |
run: | | |
tar cfz site.tar.gz _site/ | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: documents | |
path: site.tar.gz | |
deploy: | |
needs: [build] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: documents | |
- name: Extract Artifacts | |
run: | | |
tar xfz site.tar.gz | |
- name: Deploy GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_site | |
publish_branch: gh-pages | |
user_name: 'TizenAPI-Bot' | |
user_email: '[email protected]' | |
full_commit_message: 'Update documents' |