-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (78 loc) · 2.45 KB
/
blog-bitix-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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: blog-bitix-deploy
on:
push:
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: deploy/
ref: gh-pages
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Environment information
run: |
uname -a
lsb_release -a
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Cache hugo resources
uses: actions/cache@v4
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: Install packages (npm)
run: |
npm install
- name: Echo content
run: |
ls
- name: Echo content (deploy)
run: |
ls deploy/
- name: Generate styles
run: |
npm run less-main
hugo gen chromastyles --style=github > themes/bitix/static/assets/css/syntax.css
- name: Generate content
run: |
hugo --destination="deploy/" --gc --cleanDestinationDir
- name: Generate content (fixes)
run: |
cp deploy/index.xml deploy/atom.xml
mkdir -p deploy/categories/planeta-codigo/
cp deploy/tags/planeta-codigo/index.xml deploy/categories/planeta-codigo/atom.xml
- name: Echo content (deploy)
run: |
ls deploy/
- name: Deploy
run: |
cd 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 ..