Skip to content

Commit bb1f753

Browse files
authored
Update deploy.yml - Auto convert readme to html
1 parent b7f3906 commit bb1f753

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020
build-and-deploy:
2121
runs-on: ubuntu-latest
2222
steps:
23-
# --- Step 1: Check out the 'main' branch ---
23+
# --- Check out the 'main' branch ---
2424
# This downloads your main branch code into the workflow runner.
2525
- name: Checkout main branch
2626
uses: actions/checkout@v4
2727
with:
2828
path: main # Checkout to a 'main' subdirectory
2929

30-
# --- Step 2: Check out the 'caches' branch ---
30+
# --- Check out the 'caches' branch ---
3131
# This downloads your caches branch into a different subdirectory.
3232
# This step will fail if the 'caches' branch doesn't exist yet, which is fine on the first run.
3333
- name: Checkout caches branch
@@ -37,7 +37,7 @@ jobs:
3737
path: caches # Checkout to a 'caches' subdirectory
3838
continue-on-error: true
3939

40-
# --- Step 3: Combine the files ---
40+
# --- Combine the files ---
4141
- name: Combine files
4242
run: |
4343
# Create a 'public' directory to hold the final website files
@@ -50,14 +50,26 @@ jobs:
5050
if [ -d "./caches" ]; then
5151
cp -r ./caches/* ./public/
5252
fi
53+
54+
# --- Install Pandoc ---
55+
- name: Install pandoc
56+
run: |
57+
sudo apt-get update
58+
sudo apt-get install -y pandoc
59+
60+
# --- Convert README.md to index.html ---
61+
- name: Convert README to index.html
62+
run: |
63+
pandoc --standalone --metadata pagetitle="Home" -M linkcolor="#007bff" -M mainfont="sans-serif" -M maxwidth="45em" -f gfm -t html ./public/README.md -o ./public/index.html
64+
5365
54-
# --- Step 4: Upload the combined site ---
66+
# --- Upload the combined site ---
5567
- name: Upload artifact
5668
uses: actions/upload-pages-artifact@v3
5769
with:
5870
path: ./public
5971

60-
# --- Step 5: Deploy to GitHub Pages ---
72+
# --- Deploy to GitHub Pages ---
6173
- name: Deploy to GitHub Pages
6274
id: deployment
6375
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)