This is an automated email from the ASF dual-hosted git repository.

jiafengzheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d37d981485 add generate pdf action (#228)
7d37d981485 is described below

commit 7d37d981485d5385910850039eaac90b220f9d1e
Author: wangyongfeng <943155...@qq.com>
AuthorDate: Thu May 11 15:11:40 2023 +0800

    add generate pdf action (#228)
---
 .github/workflows/cron-generate-pdf.yml   | 41 ++++++++++++++++++++++++++
 .github/workflows/manual-generate-pdf.yml | 48 +++++++++++++++++++++++++++++++
 2 files changed, 89 insertions(+)

diff --git a/.github/workflows/cron-generate-pdf.yml 
b/.github/workflows/cron-generate-pdf.yml
new file mode 100644
index 00000000000..4a9b72985f3
--- /dev/null
+++ b/.github/workflows/cron-generate-pdf.yml
@@ -0,0 +1,41 @@
+name: Cron Generate Pdf
+
+on: 
+  schedule:
+    - cron: '0 1 * * *'
+
+jobs:
+  build-and-deploy:
+    runs-on: ubuntu-latest
+    environment: Production
+    steps:
+    - name: Checkout
+      uses: actions/checkout@master
+      with:
+          persist-credentials: false
+          submodules: recursive
+
+    - name: Use Node.js
+      uses: actions/setup-node@v3
+      with:
+        node-version: 16.14.0
+
+   - name: Generate PDF
+      run: |
+        npx vitpress-generate-pdf 
--initialDocURLs="https://doris.apache.org/docs/dev/get-starting/"; 
--paginationSelector=".pagination-nav__link--next" --contentSelector="article" 
--coverImage="https://cdn.selectdb.com/static/doris_logo_512_4903556647.png"; 
--coverTitle="Apache Doris Docs (English)" --outputPDFFilename="Apache Doris 
Docs (English).pdf" --tocOnlyH1=true
+        npx vitpress-generate-pdf 
--initialDocURLs="https://doris.apache.org/zh-CN/docs/dev/get-starting/"; 
--paginationSelector=".pagination-nav__link--next" --contentSelector="article" 
--coverImage="https://cdn.selectdb.com/static/doris_logo_512_4903556647.png"; 
--coverTitle="Apache Doris Docs (中文)" --outputPDFFilename="Apache Doris Docs 
(中文).pdf" --tocOnlyH1=true
+        mkdir -p ./build-pdf/assets/files/
+        cp *.pdf ./build-pdf/assets/files/
+        ls ./build-pdf/assets/files/
+
+
+    - name: Upload files to OSS
+      uses: ./.github/actions/aliyun-oss-website-action
+      with:
+          accessKeyId: ${{ secrets.ALIYUN_ACCESS_KEY_ID }}
+          accessKeySecret: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }}
+          bucket: ${{ secrets.ALIYUN_OSS_BUCKET }}
+          # use your own endpoint
+          endpoint: ${{ secrets.ALIYUN_OSS_ENDPOINT }}
+          folder: build-pdf
+          onlyUpload: true
\ No newline at end of file
diff --git a/.github/workflows/manual-generate-pdf.yml 
b/.github/workflows/manual-generate-pdf.yml
new file mode 100644
index 00000000000..2d28c8cc553
--- /dev/null
+++ b/.github/workflows/manual-generate-pdf.yml
@@ -0,0 +1,48 @@
+name: Generate Pdf And Upload To OSS
+
+
+on: 
+  workflow_dispatch:
+    inputs:
+      branch:
+        description: 'Specify the branch name'
+        required: true
+        default: 'master'
+  
+jobs:
+  build-and-deploy:
+    runs-on: ubuntu-latest
+    environment: Production
+    steps:
+    - name: Checkout
+      uses: actions/checkout@master
+      with:
+          persist-credentials: false
+          submodules: recursive
+
+
+    - name: Use Node.js
+      uses: actions/setup-node@v3
+      with:
+        node-version: 16.14.0
+
+
+    - name: Generate PDF
+      run: |
+        npx vitpress-generate-pdf 
--initialDocURLs="https://doris.apache.org/docs/dev/get-starting/"; 
--paginationSelector=".pagination-nav__link--next" --contentSelector="article" 
--coverImage="https://cdn.selectdb.com/static/doris_logo_512_4903556647.png"; 
--coverTitle="Apache Doris Docs (English)" --outputPDFFilename="Apache Doris 
Docs (English).pdf" --tocOnlyH1=true
+        npx vitpress-generate-pdf 
--initialDocURLs="https://doris.apache.org/zh-CN/docs/dev/get-starting/"; 
--paginationSelector=".pagination-nav__link--next" --contentSelector="article" 
--coverImage="https://cdn.selectdb.com/static/doris_logo_512_4903556647.png"; 
--coverTitle="Apache Doris Docs (中文)" --outputPDFFilename="Apache Doris Docs 
(中文).pdf" --tocOnlyH1=true
+        mkdir -p ./build-pdf/assets/files/
+        cp *.pdf ./build-pdf/assets/files/
+        ls ./build-pdf/assets/files/
+
+
+    - name: Upload files to OSS
+      uses: ./.github/actions/aliyun-oss-website-action
+      with:
+          accessKeyId: ${{ secrets.ALIYUN_ACCESS_KEY_ID }}
+          accessKeySecret: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }}
+          bucket: ${{ secrets.ALIYUN_OSS_BUCKET }}
+          # use your own endpoint
+          endpoint: ${{ secrets.ALIYUN_OSS_ENDPOINT }}
+          folder: build-pdf
+          onlyUpload: true
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to