-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
38 lines (33 loc) · 925 Bytes
/
.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
#sudo-enabled VM required to get latest snap of Hugo
sudo: required
dist: trusty
# Install the apt prerequisites and hugo
addons:
apt:
packages:
- python-pygments
- snapd
# Clean public folder
install:
- sudo snap install hugo
- rm -rf public || exit 0
# Build the website
# IMPORTANT Hugo options go here!
script:
- git submodule foreach git pull origin main #always pull latest update of theme
- /snap/bin/hugo -b https://hamzahch.com -d public --gc --minify
- touch public/CNAME
- echo "hamzahch.com" >> public/CNAME
after_failure:
- echo "Build Failed"
- exit 1
#git --force push to master
deploy:
provider: pages
skip_cleanup: true
local_dir: public
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
target_branch: main #org pages use master not gh-pages
on:
branch: hugo-source #only deploy from hugo-source branch
condition: $TRAVIS_TEST_RESULT = 0