Skip to content

Commit 9a86ca3

Browse files
author
dreamos82
committed
Merge pull request 'Add codeberg actions' (#144) from add_codeberg_actions into master
Reviewed-on: https://codeberg.org/dreamportdev/Osdev-Notes/pulls/144
2 parents fcaf523 + a73f26a commit 9a86ca3

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow is triggered everytime a push is made on master.
2+
# It will trigger the pdf build and publish it on the "Development" release
3+
name: Pandoc Automation
4+
5+
# It will run on every push on master
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
paths-ignore: [ '**/README.md', '**/FUNDING.yml', '**/sync-gh-pages.yaml' ]
10+
branches: [ master ]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
jobs:
15+
# This workflow contains a single job called "build"
16+
build:
17+
# It will run on ubuntu-latest image
18+
runs-on: codeberg-medium
19+
steps:
20+
- uses: https://code.forgejo.org/actions/checkout@v7
21+
- name: Install dependencies
22+
# We need to manually install pandoc, because the version carried with ubuntu 22.04 is affected by a bug that cause the build to fail
23+
run: |
24+
sudo apt-get -y update
25+
sudo apt-get -y upgrade
26+
sudo apt-get -y install texlive-latex-base texlive texlive-xetex texlive-fonts-recommended librsvg2-2 liblua5.3-0 librsvg2-bin librsvg2-common libgmp10 pandoc pandoc-data
27+
- name: Run build script
28+
run: |
29+
pandoc -v
30+
echo "Updating permissions on build script"
31+
chmod +x build.sh
32+
echo "Bulding"
33+
ON_CODEBERG=1 ADD_COMMIT=1 ./build.sh
34+
echo "Next step: creating release!"
35+
- uses: https://code.forgejo.org/actions/forgejo-release@v2.13.1
36+
with:
37+
token: ${{ forge.token }}
38+
tag: latest-master
39+
direction: upload
40+
release-dir: output
41+
override: true

build.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
OUTPUT_FOLDER = ""
4+
35
get_entries() {
46
echo $(find $1 -maxdepth 1 -regextype egrep -regex '.*\/[0-9A-Z]{1,2}_[A-Za-z_.]*' | sort)
57
}
@@ -40,4 +42,11 @@ if [ -v ADD_COMMIT ]; then
4042
mv .pandoc/pandoc_1.yaml .pandoc/pandoc.yaml
4143
fi
4244

43-
$(pandoc $pandoc_flags $cmd_body .pandoc/pandoc.yaml -o $pandoc_filename)
45+
if [ -v ON_CODEBERG ]; then
46+
echo "CODEBERG env identified, creating output directory"
47+
mkdir output
48+
OUTPUT_FOLDER="output/"
49+
echo $OUTPUT_FOLDER
50+
fi
51+
52+
$(pandoc $pandoc_flags $cmd_body .pandoc/pandoc.yaml -o $OUTPUT_FOLDER$pandoc_filename)

0 commit comments

Comments
 (0)