From d3e994efd6f9d19f9996fac8b03e1cfa3dcc17a6 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Fri, 14 May 2021 16:15:48 +0900 Subject: [PATCH] [Build] Add a github workflow to deploy tizen docs (#3040) --- .../workflows/deploy-documents-for-tizen-docs.yml | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/deploy-documents-for-tizen-docs.yml diff --git a/.github/workflows/deploy-documents-for-tizen-docs.yml b/.github/workflows/deploy-documents-for-tizen-docs.yml new file mode 100644 index 0000000..bd2df9f --- /dev/null +++ b/.github/workflows/deploy-documents-for-tizen-docs.yml @@ -0,0 +1,72 @@ +name: "Deploy Documents for Tizen Docs" + +on: + schedule: + - cron: "0 17 * * *" + workflow_dispatch: + +env: + DOCFX_FILE: docfx_tizen_docs.json + DEPLOY_BRANCH: tizen-docs-pages + CACHE_NAME: docfx-tizen-docs-pages-site + +jobs: + + build: + runs-on: [self-hosted, linux, x64] + container: + image: tizendotnet/tizenfx-build-worker:2.1 + + steps: + - uses: actions/checkout@v2 + 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: | + tar cfz site.tar.gz _site/ + + - uses: actions/upload-artifact@v2 + with: + name: documents + path: site.tar.gz + + deploy: + needs: [build] + runs-on: ubuntu-latest + + 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@v3 + 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' -- 2.7.4