From 084743df2c46f8ce534e563d0f9884e1a65a1d53 Mon Sep 17 00:00:00 2001 From: milovann Date: Tue, 3 Dec 2024 15:26:11 +0100 Subject: [PATCH] add pages --- .forgejo/workflows/web.yaml | 25 +++++++++++++++++++++++++ dist/.gitignore | 1 + pages/index.md | 1 + scripts/index.html | 0 scripts/web.sh | 10 ++++++++++ 5 files changed, 37 insertions(+) create mode 100644 .forgejo/workflows/web.yaml create mode 100644 dist/.gitignore create mode 100644 pages/index.md create mode 100644 scripts/index.html create mode 100755 scripts/web.sh diff --git a/.forgejo/workflows/web.yaml b/.forgejo/workflows/web.yaml new file mode 100644 index 0000000..3c2935a --- /dev/null +++ b/.forgejo/workflows/web.yaml @@ -0,0 +1,25 @@ +on: [push] +jobs: + automate-ifc: + runs-on: self-hosted + steps: + - name: Install checkout + uses: https://github.com/actions/checkout@v4 + with: + fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. + - name: Get changed files + id: changed-files + uses: https://github.com/tj-actions/changed-files@v42 + - name: Do computations + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + run: | + if [[ ! -d web ]] + then + git clone https://git.forgeons.org/rvba/web + fi + cd web && git pull + cd scripts + for file in ${ALL_CHANGED_FILES}; do + ./web.sh "$file" + diff --git a/dist/.gitignore b/dist/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/dist/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/pages/index.md b/pages/index.md new file mode 100644 index 0000000..7cbaf4b --- /dev/null +++ b/pages/index.md @@ -0,0 +1 @@ +# Forgeons ! diff --git a/scripts/index.html b/scripts/index.html new file mode 100644 index 0000000..e69de29 diff --git a/scripts/web.sh b/scripts/web.sh new file mode 100755 index 0000000..65770ab --- /dev/null +++ b/scripts/web.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +file=$1 +filename=$(basename -- "$file") +extension="${filename##*.}" +filename="${filename%.*}" + +#echo "making $filename.html" + +pandoc ../pages/$filename.md -t html > ../dist/$filename.html