-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.travis.yml
54 lines (46 loc) · 1.08 KB
/
.travis.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
#Use the new container-based infrastructure
os: linux
dist: xenial
language: go
#Install the apt prerequisites
addons:
apt_packages:
- python-pygments
#Set the build environment
env:
- HUGOV=0.88.1
before_install:
- nvm install node
#Clean and don't fail
install:
- rm -rf public || exit 0
#Download Hugo
before_script:
# - curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
# - sudo apt-get install -y nodejs
# - sudo nvm use 16.10.0
- npm i -g grunt-cli
- npm i -g yarn
- yarn set version latest
- yarn install --no-lockfile
- grunt content-index
- mkdir binaries
- wget "https://github.com/gohugoio/hugo/releases/download/v${HUGOV}/hugo_${HUGOV}_Linux-64bit.tar.gz" -O binaries/hugo_${HUGOV}_Linux-64bit.tar.gz
- cd binaries
- tar -xzf hugo_${HUGOV}_Linux-64bit.tar.gz
- chmod +x hugo
- cd ..
#Build the website
script:
- binaries/hugo --minify
#Deploy to GitHub pages
deploy:
strategy: git
provider: pages
skip_cleanup: true
local_dir: public
token: $GITHUB_TOKEN
keep_history: true
target_branch: master
on:
branch: src