shrink / actions-document-publish

:octocat: Publish a group of Markdown documents as a single PDF document

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to put pdf in the repo

jkingslake opened this issue · comments

Thanks for a useful tool.

I have it working using your first example which results in a pdf uploaded as an artifact.

I was wondering how to instead end up with the pdf in the repo.

I am working on this here: https://github.com/ldeo-glaciology/ITGC-field-doc/tree/auto-pdf

Thanks!

commented

@jkingslake I'm glad to hear it's helpful!

The action creates a file called document.pdf in a directory called .publish-docs so if you'd like to commit this file back to the repository then you could use an action like Copy file to move it to your desired place, and then Add & Commit to push it to the branch.

For example, adapting your current Workflow:

jobs:
  publish:
    runs-on: ubuntu-latest
    name: Publish Document
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Publish PDF Document
        uses: shrink/actions-document-publish@v1
        id: publish-document
        with:
          sources: 'title.md index.md'
      - uses: canastro/copy-file-action@master
        with:
          source: ".publish-docs/document.pdf"
          target: "my-pdf-name.pdf"
      - uses: EndBug/add-and-commit@v7
        with:
          add: "my-pdf-name.pdf" # same as `target` in the previous step
          default_author: github_actions

note: I haven't tested that, but it should work. Let me know if you run into any issues :)

This is working! Thank you so much!