-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
73 lines (68 loc) · 2.06 KB
/
.gitlab-ci.yml
File metadata and controls
73 lines (68 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
default:
image:
name: ghcr.io/prefix-dev/pixi
cache:
key: "$CI_JOB_NAME"
paths:
- .pixi
- _build
before_script:
- eval $(pixi shell-hook --shell bash)
- pixi global install git
- git config --global --add safe.directory $CI_PROJECT_DIR
- pixi install
- eval "$(pixi run ssh-agent -s)"
- chmod 400 "$WEBSITE_UPLOAD_KEY"
- pixi run ssh-add "$WEBSITE_UPLOAD_KEY" >/dev/null
variables:
FF_USE_FASTZIP: "true"
CACHE_COMPRESSION_LEVEL: "fastest"
SSH_COMMAND: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
JUPYTER_NUM_PROCS: "10"
HOST: "127.0.0.1" # Needed to avoid binding to ::1.
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
variables:
BASE_URL: "/branch_${CI_COMMIT_REF_SLUG}"
- if: '$CI_COMMIT_BRANCH == "master"'
- when: never
build branch website:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
variables:
WEBSITE_UPLOAD_PATH: /branch_${CI_COMMIT_REF_SLUG}
environment:
name: branch/$CI_COMMIT_REF_SLUG
on_stop: stop branch website
url: https://topocondmat.org/branch_${CI_COMMIT_REF_SLUG}/
script:
- pixi run postprocess-html
- pixi run rsync -ravz _build/html/ -e "$SSH_COMMAND" uploader@tnw-qn1.tudelft.net:$WEBSITE_UPLOAD_PATH
build main website:
only:
- master@qt/topocm
variables:
WEBSITE_UPLOAD_PATH: /
environment:
name: published
url: https://topocondmat.org/
script:
- pixi run postprocess-html
- pixi run rsync -ravz _build/html/ -e "$SSH_COMMAND" uploader@tnw-qn1.tudelft.net:$WEBSITE_UPLOAD_PATH
stop branch website:
needs:
- build branch website
script:
- mkdir -p /tmp/empty_dir
- pixi run rsync -av --delete /tmp/empty_dir/ -e "$SSH_COMMAND" uploader@tnw-qn1.tudelft.net:$WEBSITE_UPLOAD_PATH/
when: manual
environment:
name: branch/$CI_COMMIT_REF_SLUG
action: stop
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: manual
variables:
WEBSITE_UPLOAD_PATH: /branch_${CI_COMMIT_REF_SLUG}
allow_failure: true