-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (68 loc) · 2.63 KB
/
pelican.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: pelican build
on: push
# push:
# branches:
# - main
# pull_request:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r ./requirements.txt
- name: install theme
run: git clone https://github.com/alexandrevicenzi/Flex
- name: grab the pelican plugins
run: |
git clone --depth 1 --filter=blob:none --no-checkout https://github.com/getpelican/pelican-plugins/
cd pelican-plugins
git checkout master -- post_stats
git checkout master -- summary
- name: grab the pelican plugins from the new location
run: |
git clone https://github.com/pelican-plugins/image-process
mv image-process/pelican/plugins/image_process pelican-plugins/
git clone https://github.com/pelican-plugins/neighbors
mv neighbors/pelican/plugins/neighbors pelican-plugins/
git clone https://github.com/pelican-plugins/render-math
mv render-math/pelican/plugins/render_math pelican-plugins/
- name: grab the latest published version in order to not erase rss feed
run: git clone --branch gh-pages https://github.com/maggick/maggick.github.io output
- name: build
run: pelican
- name: Deploy
if: ${{ github.ref == 'refs/heads/master' }}
run: |
cd output
remote_repo="https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git"
git remote add deploy "$remote_repo"
git config user.name maggick
git config user.email maggick@users.noreply.github.com
git add ./
timestamp=$(date +%s%3N)
git commit -m "[CI] Automated deployment to GitHub Pages on $timestamp"
echo $remote_branch
git show-ref
git push deploy HEAD:gh-pages --force