-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Docs to PDF | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
converttopdf: | ||
name: build-release-pdf | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: today | ||
run: echo "name=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
|
||
# Checkout the repository | ||
- uses: actions/checkout@v3 | ||
|
||
# Install pandoc | ||
- name: Install pandoc | ||
run: sudo apt-get install -y pandoc | ||
|
||
# Create directory for PDFs | ||
- name: Create PDF directory | ||
run: mkdir -p pdfs | ||
|
||
# Concatenate all markdown files into a single file | ||
- name: Concatenate markdown files | ||
run: find . -name "*.md" -exec cat {} + > combined.md | ||
|
||
# Convert the concatenated markdown to PDF | ||
- name: Convert markdown to PDF | ||
run: pandoc combined.md -o pdfs/combined.pdf | ||
|
||
# Upload the PDF artifact | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: release | ||
path: pdfs | ||
|
||
# Create a release with the PDF | ||
- name: Create GitHub Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: release-${{ env.name }} | ||
release_name: release-${{ env.name }} | ||
draft: false | ||
prerelease: false | ||
files: pdfs/combined.pdf |