42 lines
1.5 KiB
YAML
42 lines
1.5 KiB
YAML
image: hatsoftwares/hugo-vnu:latest
|
|
stages:
|
|
- validity-check
|
|
- deploy
|
|
|
|
validity-check:
|
|
stage: validity-check
|
|
script:
|
|
- hugo --config=config.toml,`ls config/*toml | paste -sd "," -`
|
|
- find public -name index.html | xargs java -jar /opt/dist/vnu.jar
|
|
|
|
deploy:
|
|
stage: deploy
|
|
script:
|
|
- hugo --config=config.toml,`ls config/*toml | paste -sd "," -` -b "https://joinpeertube.org"
|
|
- mkdir "${HOME}/.ssh"
|
|
- chmod 700 "${HOME}/.ssh"
|
|
- if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
|
|
- eval `ssh-agent -s`
|
|
- if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then ssh-add <(echo "$DEPLOYEMENT_KEY" | base64 --decode); fi
|
|
- if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then rsync -a --delete --exclude='stats' --exclude='error' --exclude='.htaccess' public/ ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/; fi
|
|
only:
|
|
- master
|
|
|
|
trads:
|
|
stage: deploy
|
|
image: framasoft/push-trad:latest
|
|
script:
|
|
- sed -e "s@<project-version>.*</project-version>@<project-version>$CI_COMMIT_REF_SLUG</project-version>@" -i zanata.xml
|
|
- if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then mkdir -p ${HOME}/.config; echo -e "${ZANATA_CONFIG_FRAMABOT}" > ${HOME}/.config/zanata.ini; fi
|
|
- if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then make push-locales; fi
|
|
only:
|
|
- master
|
|
|
|
pages:
|
|
stage: deploy
|
|
script:
|
|
- hugo --config=config.toml,`ls config/*toml | paste -sd "," -` -b "https://$GITLAB_USER_LOGIN.frama.io/$CI_PROJECT_NAME/"
|
|
- rm public/js/pathnamereplace.js
|
|
artifacts:
|
|
paths:
|
|
- public
|