33 lines
692 B
YAML
33 lines
692 B
YAML
stages:
|
|
- fetch-and-build
|
|
- deploy
|
|
|
|
variables:
|
|
BRANCH: "develop"
|
|
|
|
|
|
fetch-and-build:
|
|
image: python:3.8-alpine
|
|
stage: fetch-and-build
|
|
artifacts:
|
|
paths:
|
|
- site/
|
|
script:
|
|
- apk add git build-base
|
|
- python3 -m ensurepip
|
|
- pip install pipenv
|
|
- pipenv sync
|
|
- pipenv run ./manage.sh all --branch $BRANCH
|
|
|
|
deploy:
|
|
image: alpine:latest
|
|
stage: deploy
|
|
only:
|
|
- master@pleroma/docs
|
|
script:
|
|
- apk update && apk add openssh-client rsync
|
|
- mkdir -p ~/.ssh
|
|
- echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
|
|
- eval $(ssh-agent -s)
|
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
|
- rsync -hrvz --delete -e "ssh -p ${SSH_PORT}" site/* "${SSH_USER_HOST_LOCATION}/${BRANCH}"
|