diff --git a/.github/workflows/cron-generate-pdf.yml b/.github/workflows/cron-generate-pdf.yml new file mode 100644 index 0000000000000..4a9b72985f337 --- /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 0000000000000..2d28c8cc55377 --- /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