wiki-hackmeeting/.gitlab-ci.yml

49 lines
1.1 KiB
YAML

default:
image: "${CI_TEMPLATE_REGISTRY_HOST}/pages/hugo/hugo_extended:latest"
variables:
GIT_SUBMODULE_STRATEGY: recursive
HUGO_ENV: production
WEBDAV_REMOTE_PATH: html-es.hackmeeting.org
WEBDAV_USERNAME: es_hackmeeting
WEBDAV_URL: https://www.autistici.org/dav/es_hackmeeting
DEST_DIRECTORY: latest/hugo
stages:
- test
- build
- push
test:
stage: test
before_script:
- apk add --no-cache go curl bash nodejs
- hugo version
- hugo mod get -u
script:
- hugo
rules:
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
build:
before_script:
- hugo version
stage: build
script:
- 'hugo --baseURL="https://es.hackmeeting.org/${DEST_DIRECTORY}"'
artifacts:
paths:
- public
push:
stage: push
image:
name: rclone/rclone:latest
entrypoint: [""]
script:
- "rclone sync -v --retries 10 --exclude='hm/**' --webdav-url ${WEBDAV_URL} --webdav-user ${WEBDAV_USERNAME} --webdav-pass $(echo -n \"${WEBDAV_PASSWORD}\" | rclone obscure -) ./public :webdav:${WEBDAV_REMOTE_PATH}/${DEST_DIRECTORY}"
dependencies:
- build
only:
- no-masters