-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 926 Bytes
/
CD.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
name: CD
on: pull_request
jobs:
Build:
runs-on:
- self-hosted
- CI-CD
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
token: ${{ secrets.BUILD_WEBSITE_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Init theme submodule
run: git submodule update --init
- name: Copy custom CSS in theme
run: cp custom.css themes/anatole/assets/css/custom.css
- name: Build website
run: rm -rf public && hugo
- name: Commit automated build
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
if [ "$(git status --porcelain public)" ]; then
git add public
git commit -m "Automated build"
git push
else
echo "No changes to commit"
fi