-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (49 loc) · 1.88 KB
/
mdToHTML.yml
File metadata and controls
65 lines (49 loc) · 1.88 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
60
61
62
63
64
65
name: Convert Markdown to HTML
on:
push:
branches:
- main
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '^1.16'
- name: Install dependencies
run: go mod init blackfriday; go get github.com/russross/blackfriday/v2
- name: Convert Markdown to HTML
run: go run ./src/convert_md_2_html.go
working-directory: ${{ github.workspace }}
- name: Find HTML Content and move to temp folder
run: |
mkdir -p www-temp
find platforms -type f -name \*.html | while read a; do mv $a ./www-temp/; done
working-directory: ${{ github.workspace }}
# Adding HTML CSS Header
- name: Adding HTML CSS Header
run: |
cd www-temp
mkdir css
cp ../src/css/*.html css
cp ../src/css/*.css .
ls -1 *.html | while read i; do cp css/header.html tmp.html; cat $i >> tmp.html; mv tmp.html $i; rm -f tmp.html; done
ls -1 *.html | while read i; do echo "-----------------"; cat $i; done
working-directory: ${{ github.workspace }}
# Setting up Git user to commit to the gh-pages branch
- name: Configure Git User
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
# Deploy to GitHub Pages
- name: Deploy no GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.WEBSITE_PAT }}
publish_dir: www-temp # Directory where HTML files are stored
publish_branch: gh-pages
keep_files: false