-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.81 KB
/
main.yml
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
name: CI
on:
push:
branches: [ master ]
repository_dispatch:
types: trigger-ci
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Checkout clean-blog template
shell: bash
run: git clone https://github.com/codernr/startbootstrap-clean-blog.git templates/clean-blog
- name: Download latest Bloggen.Net
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GithubToken }}
USER_MAIL: ${{ secrets.Mail }}
run: |
latest_data=$(curl -s "https://api.github.com/repos/codernr/bloggen-net/releases/latest")
download_url=$(egrep -oh -m 1 "(https://github.com/codernr/bloggen-net/releases/download/v[0-9]\.[0-9]\.[0-9]/v[0-9]\.[0-9]\.[0-9]\.tar\.gz)" <<< $latest_data)
curl -L $download_url --output bloggen-net.tar.gz
tar -zxvf bloggen-net.tar.gz
- name: Generate site
shell: bash
run: |
cd deploy
dotnet Bloggen.Net.dll -s "${PWD}/../" -o bloggen-output
- name: Update blog repository
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GithubToken }}
USER_MAIL: ${{ secrets.Mail }}
run: |
cd deploy
git clone "https://codernr:${GITHUB_TOKEN}@github.com/codernr/codernr.github.io.git"
rm -rf codernr.github.io/*/ codernr.github.io/*.html
cp -rf bloggen-output/* codernr.github.io/
cd codernr.github.io
git config user.name codernr
git config user.email $USER_MAIL
git add --all
git commit -am "Automatic github pages update from blog-source CI"
git push
- name: Clean files
shell: bash
run: |
rm -rf deploy templates
rm bloggen-net.tar.gz