mirror of
https://github.com/donnemartin/system-design-primer.git
synced 2025-12-19 11:28:57 +03:00
Add pandoc for PDF creation and GitHub Actions for auto-generation
This commit is contained in:
46
.github/workflows/main.yml
vendored
Normal file
46
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
name: Generate PDF using Pandoc
|
||||
|
||||
# Controls when the workflow will run
|
||||
on:
|
||||
# Triggers the workflow on push or pull request events but only for the master branch
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called "create_pdf"
|
||||
create_pdf:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Pandoc Docker image v3.2.1.0
|
||||
container:
|
||||
image: pandoc/latex:3.2.1.0
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# Run the PDF creation script in the container
|
||||
- uses: docker://pandoc/latex:3.2.1.0
|
||||
with:
|
||||
entrypoint: './pandoc-docker.sh'
|
||||
|
||||
# Create an output with the shortened version of the commit SHA
|
||||
- id: short_sha
|
||||
env:
|
||||
GITHUB_SHA: ${{ github.sha }}
|
||||
run: echo "::set-output name=short_sha::$(echo ${GITHUB_SHA::7})"
|
||||
|
||||
# Create a release with the PDFs as assets and the shortened SHA as the tag name
|
||||
- uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: v${{ steps.short_sha.outputs.short_sha }}
|
||||
draft: false
|
||||
files: |
|
||||
*.pdf
|
||||
Reference in New Issue
Block a user