-
Notifications
You must be signed in to change notification settings - Fork 319
57 lines (54 loc) · 1.7 KB
/
alis-site-deploy.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
name: alis-site-deploy
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.135.0
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: actions/checkout@v4
with:
path: site/deploy/
ref: gh-pages
- name: Environment information
run: |
uname -a
lsb_release -a
- name: Cache hugo resources
uses: actions/cache@v2
env:
cache-name: cache-hugo-resources
with:
path: ./resources
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Install packages (hugo)
run: |
wget https://github.com/gohugoio/hugo/releases/download/v${{ env.HUGO_VERSION }}/hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz
tar xzf hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz hugo
rm hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz
chmod +x ./hugo
sudo mv ./hugo /usr/local/bin
- name: Echo content (deploy)
run: |
ls site/deploy/
- name: Generate content
run: |
cd site/
hugo gen chromastyles --style=github > themes/alis/assets/syntax.css
hugo --destination="deploy/" --gc --cleanDestinationDir
- name: Echo content (deploy)
run: |
ls site/deploy/
- name: Deploy
run: |
cd site/deploy/
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Site update at `LC_ALL=en_US.utf8 date +%Y-%m-%dT%H:%M:%S%z`"
git push origin gh-pages
cd ..