From d637a0ce751a46a3d46ed0e12bd000ac391aed8e Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Tue, 6 May 2025 23:07:00 -0400 Subject: [PATCH] add page.yml --- .github/workflows/page.yml | 38 ++++++++++++++++++++++++++++++++++++++ cmd.sh | 3 +++ processed | 1 + requirements.txt | 0 4 files changed, 42 insertions(+) create mode 100644 .github/workflows/page.yml create mode 160000 processed create mode 100644 requirements.txt diff --git a/.github/workflows/page.yml b/.github/workflows/page.yml new file mode 100644 index 00000000..1c9e66f3 --- /dev/null +++ b/.github/workflows/page.yml @@ -0,0 +1,38 @@ +name: Build and Deploy to GitHub Pages + +on: + push: + branches: [ main ] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: + contents: write + pages: write + id-token: write + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + + - name: Install dependencies 📦 + run: | + sudo apt-get update + sudo apt-get install python3 python3-polib python3-docutils pandoc python3-pip + pip3 install pypandoc + + - name: Run build script 🔧 + run: | + chmod +x ./cmd.sh + chmod +x ./run.sh + ./run.sh + + - name: Deploy to GitHub Pages 🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: ./processed # The folder the action should deploy + branch: gh-pages # The branch the action should deploy to + clean: true # Automatically remove deleted files from the deploy branch \ No newline at end of file diff --git a/cmd.sh b/cmd.sh index 581be213..74132c96 100755 --- a/cmd.sh +++ b/cmd.sh @@ -6,6 +6,9 @@ outdir="processed/$LANGUAGE/"$(dirname $1) input=$1 output=$(basename $1).md mkdir -p "$outdir" +if [ ! -d "$outdir/_static" ]; then + cp -r static "$processed/_static" +fi echo python3 "$main" --to-markdown --assets-dir static/ -o "$outdir/$output" "$input" "translations/$LANGUAGE/LC_MESSAGES/$posource" python3 "$main" --to-markdown --assets-dir static/ -o "$outdir/$output" "$input" "translations/$LANGUAGE/LC_MESSAGES/$posource" 2>> err.$LANGUAGE.log 1>> log.$LANGUAGE.log python3 clean_markdown.py "$outdir/$output" \ No newline at end of file diff --git a/processed b/processed new file mode 160000 index 00000000..cb29a068 --- /dev/null +++ b/processed @@ -0,0 +1 @@ +Subproject commit cb29a068a9c55d96349475080813905ee8f4755e diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..e69de29b