ci: rework deploy_docs job

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2286>
This commit is contained in:
jo 2023-01-28 21:37:55 +01:00
parent f79d71b594
commit 195fb2d8fb
1 changed files with 7 additions and 10 deletions

View File

@ -4,6 +4,8 @@ include:
file: /templates/pre-commit.yml file: /templates/pre-commit.yml
- project: funkwhale/ci - project: funkwhale/ci
file: /templates/lychee.yml file: /templates/lychee.yml
- project: funkwhale/ci
file: /templates/ssh-agent.yml
variables: variables:
PYTHONDONTWRITEBYTECODE: "true" PYTHONDONTWRITEBYTECODE: "true"
@ -335,22 +337,17 @@ build_api:
- api - api
deploy_docs: deploy_docs:
extends: .ssh-agent
stage: publish stage: publish
image: alpine
needs: needs:
- job: build_docs - job: build_docs
artifacts: true artifacts: true
before_script: rules:
- apk add openssh-client rsync - if: $CI_COMMIT_BRANCH == "stable"
- mkdir -p ~/.ssh
- echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts image: $CI_REGISTRY/funkwhale/ci/python:3.11
- chmod 644 ~/.ssh/known_hosts
- eval `ssh-agent -s`
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
script: script:
- rsync -r -e "ssh -p 2282" $CI_PROJECT_DIR/public/ docs@docs.funkwhale.audio:/htdocs/ - rsync -r -e "ssh -p 2282" $CI_PROJECT_DIR/public/ docs@docs.funkwhale.audio:/htdocs/
only:
- stable
.docker_publish: .docker_publish:
stage: publish stage: publish