forked from cemreefe/SimplyMarkdown-Test
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 2.12 KB
/
Copy pathrender.yaml
File metadata and controls
59 lines (56 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Render with SimplyMarkdown
on:
push:
branches:
- source
jobs:
run_script:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get commit message from the source branch
id: get_commit_message
run: |
# Fetch the latest commit message from the source branch
LATEST_COMMIT_MSG=$(git log -1 --pretty=%B)
echo "LATEST_COMMIT_MSG=$LATEST_COMMIT_MSG" >> $GITHUB_ENV
- name: Set up Python3
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install markdown==3.3.4 jinja2 Pygments BeautifulSoup4
- name: Clone SimplyMarkdown
run: git clone https://github.com/cemreefe/SimplyMarkdown
- name: Run SimplyMarkdown
run: |
cd SimplyMarkdown
python3 render.py -i ../source -o ../output --title 'Misty Step Blog' --css ../source/static/css/style.css --root 'https://randomblog.dutl.uk' --favicon 🏮 --rss-whitelist '/blog/*'
- name: Cleanup repo
run: |
rm -r SimplyMarkdown
- name: Clone github pages branch and clean its contents
run: |
cd ..
mkdir ghp
cd ghp
git clone -b gh-pages https://github.com/${{ github.actor }}/${{ github.event.repository.name }}
cd ${{ github.event.repository.name }}
# Delete everything from gh-pages to render anew
git rm -r '*'
- name: Move new output into github pages branch
run: |
mv output/* ../ghp/${{ github.event.repository.name }}/
- name: Commit changes
run: |
cd ../ghp/${{ github.event.repository.name }}/
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.AUTO_RENDER_PAT }}@github.com/$GITHUB_REPOSITORY
git add -A
# Prepend SimplyMarkdown - to the commit message
COMMIT_MSG="SimplyMarkdown - $LATEST_COMMIT_MSG"
git commit -m "$COMMIT_MSG"
git push