Skip to content

Commit

Permalink
Add pandoc for PDF creation and GitHub Actions for auto-generation
Browse files Browse the repository at this point in the history
  • Loading branch information
rcalixte committed Jan 26, 2022
1 parent e8a867e commit c90bf54
Show file tree
Hide file tree
Showing 30 changed files with 272 additions and 166 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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-20.04

# Pandoc Docker image v2.17.0.1
container:
image: pandoc/latex:2.17.0.1

# 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@v2

# Run the PDF creation script in the container
- uses: docker://pandoc/latex:2.17.0.1
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@v1
with:
tag_name: v${{ steps.short_sha.outputs.short_sha }}
draft: false
files: |
*.pdf
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Byte-compiled / optimized / DLL files
*.epub
*.pdf
__pycache__/
*.py[cod]

Expand Down Expand Up @@ -61,4 +62,4 @@ target/
scratch/

# IPython Notebook templates
template.ipynb
template.ipynb
2 changes: 1 addition & 1 deletion README-zh-Hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ def get_user(self, user_id):
##### 缓存的缺点:

- 请求的数据如果不在缓存中就需要经过三个步骤来获取数据,这会导致明显的延迟。
- 如果数据库中的数据更新了会导致缓存中的数据过时。这个问题需要通过设置 TTL 强制更新缓存或者直写模式来缓解这种情况。
- 如果数据库中的数据更新了会导致缓存中的数据过时。这个问题需要通过设置 TTL 强制更新缓存或者直写模式来缓解这种情况。
- 当一个节点出现故障的时候,它将会被一个新的节点替代,这增加了延迟的时间。

#### 直写模式
Expand Down
Loading

0 comments on commit c90bf54

Please sign in to comment.