1
0
Fork 0

Add GitHub Actions workflow for converting and deploying files

This commit is contained in:
ATQlove 2024-07-18 10:57:12 +08:00
parent f8dd500758
commit 05ddb3347c
1 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,36 @@
name: Convert and Deploy
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Pandoc
run: sudo apt-get install -y pandoc
- name: Find and Convert TeXmacs to Docx
run: |
mkdir -p converted_files
find . -name "*.tm" -print0 | while IFS= read -r -d '' file; do
output="converted_files/${file%.tm}.docx"
mkdir -p "$(dirname "$output")"
pandoc "$file" -o "$output"
done
- name: Deploy to gh-pages branch
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git checkout --orphan gh-pages
git reset --hard
cp -r converted_files/* .
git add .
git commit -m "Deploy converted files to GitHub Pages"
git push -f origin gh-pages