[action] add an action for update docs
authorYelin Jeong <yelini.jeong@samsung.com>
Fri, 10 Mar 2023 02:11:57 +0000 (11:11 +0900)
committer추지호/NPU Lab(SR)/삼성전자 <jiho.chu@samsung.com>
Wed, 15 Mar 2023 05:03:46 +0000 (14:03 +0900)
This patch adds a github action for update docs to NPU_DDK_DOCS.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
.github/workflows/update-document.yml [new file with mode: 0644]

diff --git a/.github/workflows/update-document.yml b/.github/workflows/update-document.yml
new file mode 100644 (file)
index 0000000..9793932
--- /dev/null
@@ -0,0 +1,49 @@
+name: update NPU_DDK_DOCS
+
+on:
+  schedule:
+    # scheduled workflow run on the latest commit on the default or base
+    # branch.
+    - cron: '00 01 * * 0'
+
+env:
+  BART_ID: ${{ secrets.BART_ID }}
+  BART_PW: ${{ secrets.BART_PW }}
+
+jobs:
+  update-documents:
+    runs-on: [ code-default ]
+    container:
+      image: aip-docker-local.bart.sec.samsung.net/n2s2_docker/bionic:latest
+      # for chroot-based build system
+      options: --privileged
+      credentials:
+        username: ${{ secrets.BART_ID }}
+        password : ${{ secrets.BART_PW }}
+
+    timeout-minutes: 30
+
+    steps:
+      - name: Clone your repository
+        uses: CODE-Actions/checkout@v2
+      - name: Create html using hotdoc
+        run: |
+          export LC_ALL=C.UTF-8
+          bash docs/gen-hotdoc.sh
+          mv docs/build/html ~/docs
+        shell: bash
+      - name: Upload docs
+        run: |
+          git config --global user.name "${{ secrets.GIT_ID }}"
+          git config --global user.email "${{ secrets.GIT_EMAIL }}"
+          git clone https://${{ secrets.GIT_ID }}:${{ secrets.GIT_PW }}@github.sec.samsung.net/AIP/NPU_DDK_DOCS.git
+
+          cd NPU_DDK_DOCS
+          rm -rf docs
+          mv ~/docs .
+
+          git remote set-url origin https://${{ secrets.GIT_ID }}:${{ secrets.GIT_PW }}@github.sec.samsung.net/AIP/NPU_DDK_DOCS.git
+          git add .
+          git commit -s -m "Update NPU-DDK Docs"
+          git push --set-upstream origin master
+        shell: bash