Skip to content

Deploy Documents for Tizen Docs #1299

Deploy Documents for Tizen Docs

Deploy Documents for Tizen Docs #1299

name: "Deploy Documents for Tizen Docs"
on:
schedule:
- cron: "0 17 * * *"
workflow_dispatch:
env:
DEPLOY_BRANCH: tizen-docs-pages
CACHE_NAME: docfx-tizen-docs-pages-site
jobs:
build:
runs-on: ubuntu-20.04
container:
image: tizendotnet/tizenfx-build-worker:2.5
options: --ulimit nofile=10240:10240
steps:
- uses: actions/checkout@v3
with:
repository: TizenAPI/TizenFX-Docs
- name: Checkout TizenFX sources
run: |
./build.sh clone
- name: Cache DocFX output
id: cache-site
uses: actions/cache@v2
with:
path: _site
key: ${{ env.CACHE_NAME }}-${{ hashFiles('repos/commits') }}
- name: Build Documents
if: steps.cache-site.outputs.cache-hit != 'true'
run: |
./build.sh restore
./build.sh build
- name: Archive Artifacts
run: |
cp .gitattributes _site/
tar cfz site.tar.gz _site/
- uses: actions/upload-artifact@v3
with:
name: documents
path: site.tar.gz
deploy:
needs: [build]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v3
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: ${{ env.DEPLOY_BRANCH }}
user_name: 'TizenAPI-Bot'
user_email: 'tizenapi@samsung.com'
full_commit_message: 'Update documents'