Skip to content

Commit 375f733

Browse files
committed
Use Travis CI for building docker images and docs
1 parent 74efa00 commit 375f733

2 files changed

Lines changed: 39 additions & 12 deletions

File tree

.travis.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
language: go
2-
install:
3-
- export HUGO_VERSION=0.20
4-
- export HUGO_PACKAGE=hugo_${HUGO_VERSION}_Linux-64bit
5-
- curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz
6-
- mkdir $HOME/bin
7-
- mv ./hugo_${HUGO_VERSION}_linux_amd64/hugo_${HUGO_VERSION}_linux_amd64 $HOME/bin/hugo
8-
script:
9-
- rm -rf docs
10-
- cd DOCUMENTATION/_settings
11-
- hugo
1+
language: bash
2+
sudo: required
3+
services:
4+
- docker
5+
6+
env:
7+
matrix:
8+
- PHP_VERSION=56
9+
- PHP_VERSION=70
10+
- PHP_VERSION=71
11+
- HUGO_VERSION=0.20
12+
13+
script: ./scripts/build.sh
1214

1315
deploy:
1416
provider: pages
1517
skip_cleanup: true
16-
local_dir: public
18+
local_dir: ../../docs
1719
github_token: $GITHUB_TOKEN
1820
on:
1921
branch: master
22+
condition: "-n ${HUGO_VERSION}"
2023

2124
notifications:
2225
email: false

scripts/build.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
if [ -n ${PHP_VERSION} ]; then
4+
cp env-example .env
5+
docker-compose build
6+
docker images
7+
fi
8+
9+
if [ -n ${HUGO_VERSION} ]; then
10+
HUGO_PACKAGE=hugo_${HUGO_VERSION}_Linux-64bit
11+
HUGO_BIN=hugo_${HUGO_VERSION}_linux_amd64
12+
13+
# Download hugo binary
14+
curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz
15+
mkdir $HOME/bin
16+
mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo
17+
18+
# Remove existing docs
19+
rm -r ./docs
20+
21+
# Build docs
22+
cd DOCUMENTATION/_settings
23+
hugo
24+
fi

0 commit comments

Comments
 (0)