From c0f0e64dd570c9a399666a774cddf9b5b7bf3dda Mon Sep 17 00:00:00 2001 From: jiayouba233 <72449367+jiayouba233@users.noreply.github.com> Date: Wed, 20 Apr 2022 23:12:05 +0800 Subject: [PATCH] Update build-pdf.yml --- .github/workflows/build-pdf.yml | 47 +++++++++++++++------------------ 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-pdf.yml b/.github/workflows/build-pdf.yml index 2829d44..62f58d2 100644 --- a/.github/workflows/build-pdf.yml +++ b/.github/workflows/build-pdf.yml @@ -1,32 +1,29 @@ -name: Convert PDF to Markdown - +name: Docs to PDF +# This workflow is triggered on pushes to the repository. on: push: + branches: + - master + # Paths can be used to only trigger actions when you have edited certain files, such as a file within the /docs directory paths: - - '**.md' + - '**/**.md' jobs: - convert_md: + converttopdf: + name: Build PDF runs-on: ubuntu-latest steps: - # We must checkout the latest version of the code to get a copy of all .md files - - name: Checkout Code - uses: actions/checkout@v2.0.0 - with: - fetch-depth: 1 - - name: Create .pdfs - uses: scottypate/md-to-pdf@v0.1.1 - env: { - # Use this parameter to determine where the generated .pdf(s) will be stored. - PDF_DIR: './pdfs' - } - - name: Create Pull Request - uses: peter-evans/create-pull-request@v1.6.1 - env: - # The token is built in to actions. No config required. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMMIT_MESSAGE: Add .pdf files. - PULL_REQUEST_TITLE: Add .pdf files. - PULL_REQUEST_BRANCH: pdf-add - PULL_REQUEST_BODY: :wave: Run.pdf - PULL_REQUEST_REVIEWERS: scottypate + - uses: actions/checkout@v2 + - uses: baileyjm02/markdown-to-pdf@v1 + with: + input_dir: docs + output_dir: pdfs + images_dir: docs/images + # for example + image_import: ./images + # Default is true, can set to false to only get PDF files + build_html: false + - uses: actions/upload-artifact@v1 + with: + name: docs + path: pdfs