Skip to content

Commit

Permalink
Create GitHub action (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
tri2820 authored Oct 18, 2024
1 parent ac5d6fd commit ba5ecd9
Show file tree
Hide file tree
Showing 23 changed files with 788 additions and 5 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/render_on_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Render

on:
push:
branches:
- "**"

jobs:
render:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: "Fix cache permissions"
run: |
sudo chmod aoug+rw -R /var/cache/apt
- name: Cache apt package lists and downloaded deb files
uses: actions/cache@v3
with:
path: |
/var/cache/apt/archives/**.deb
!/var/cache/apt/archives/partial
!/var/cache/apt/archives/lock
key: apt-packages-cache
restore-keys: |
${{ runner.os }}-apt
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y pandoc inkscape texlive-latex-base texlive-fonts-extra texlive-extra-utils poppler-utils
- name: Run the PDF rendering script in the renderer folder
run: make
working-directory: renderer

- name: Upload PDF files as an artifact
uses: actions/upload-artifact@v4
with:
name: booklet
path: renderer/*.pdf

release:
needs: render
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Download PDF artifacts
uses: actions/download-artifact@v4
with:
name: booklet
path: ./renderer

- name: List downloaded PDF files
run: ls -la ./renderer

- name: Get current date
id: current_date
run: echo "current_date=$(date +'%d%m%y-%H%M')" >> $GITHUB_ENV

- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v1
with:
tag_name: release-${{ env.current_date }}
name: Release - ${{ env.current_date }}
body: |
This release was generated automatically upon a successful merge (new article added).
files: ./renderer/*.pdf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# .gitignore

# emacs backup files
*~
*~
1 change: 1 addition & 0 deletions 2024/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*/*.tex
18 changes: 16 additions & 2 deletions 2024/another_sample_article_topic_name/article.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# This is a Draft article
Here is the content of the article.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
This article serves as a test to see if all Markdown features are rendered correctly. Markdown files will be converted into Latex files and compiled into this PDF.

You can **bold text** to emphasize important points or *italicize text* for a softer emphasis. You can also ~~cross out text~~ to indicate removal or edits.

> This is a
> blockquote that can be used to highlight important quotes or thoughts.
Inline code can be added like this: `const x = 10;`.


To include code blocks, use triple backticks:
```python
def greet():
print("Hello World!")
```

Binary file not shown.
27 changes: 27 additions & 0 deletions 2024/another_sample_article_topic_name/illustration.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions 2024/example_of_another_article_getting_accepted/article.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This is a Draft article

This article serves as a test to see if all Markdown features are rendered correctly. Markdown files will be converted into Latex files and compiled into this PDF.

You can **bold text** to emphasize important points or *italicize text* for a softer emphasis. You can also ~~cross out text~~ to indicate removal or edits.

> This is a
> blockquote that can be used to highlight important quotes or thoughts.
Inline code can be added like this: `const x = 10;`.


To include code blocks, use triple backticks:
```python
def greet():
print("Hello World!")
```

Loading

0 comments on commit ba5ecd9

Please sign in to comment.