Merge remote-tracking branch 'origin/master' into tizen
[platform/core/csapi/tizenfx.git] / .github / workflows / deploy-documents-for-tizen-docs.yml
1 name: "Deploy Documents for Tizen Docs"
2
3 on:
4   schedule:
5   - cron: "0 17 * * *"
6   workflow_dispatch:
7
8 env:
9   DOCFX_FILE: docfx_tizen_docs.json
10   DEPLOY_BRANCH: tizen-docs-pages
11   CACHE_NAME: docfx-tizen-docs-pages-site
12
13 jobs:
14
15   build:
16     runs-on: [self-hosted, linux, x64]
17     container:
18       image: tizendotnet/tizenfx-build-worker:2.0
19
20     steps:
21     - uses: actions/checkout@v2
22       with:
23         repository: TizenAPI/TizenFX-Docs
24
25     - name: Checkout TizenFX sources
26       run: |
27         ./build.sh clone
28
29     - name: Cache DocFX output
30       id: cache-site
31       uses: actions/cache@v2
32       with:
33         path: _site
34         key: ${{ env.CACHE_NAME }}-${{ hashFiles('repos/commits') }}
35
36     - name: Build Documents
37       if: steps.cache-site.outputs.cache-hit != 'true'
38       run: |
39         ./build.sh restore
40         ./build.sh build
41
42     - name: Archive Artifacts
43       run: |
44         tar cfz site.tar.gz _site/
45
46     - uses: actions/upload-artifact@v2
47       with:
48         name: documents
49         path: site.tar.gz
50
51   deploy:
52     needs: [build]
53     runs-on: ubuntu-latest
54
55     steps:
56     - uses: actions/download-artifact@v2
57       with:
58         name: documents
59
60     - name: Extract Artifacts
61       run: |
62         tar xfz site.tar.gz
63
64     - name: Deploy GitHub Pages
65       uses: peaceiris/actions-gh-pages@v3
66       with:
67         github_token: ${{ secrets.GITHUB_TOKEN }}
68         publish_dir: ./_site
69         publish_branch: ${{ env.DEPLOY_BRANCH }}
70         user_name: 'TizenAPI-Bot'
71         user_email: 'tizenapi@samsung.com'
72         full_commit_message: 'Update documents'