2023-07-08 12:22:58 +02:00
|
|
|
.build:
|
2023-07-08 12:08:27 +02:00
|
|
|
before_script:
|
|
|
|
# Handle the Yarn
|
|
|
|
- echo 'yarn-offline-mirror ".yarn-cache/"' >> .yarnrc
|
|
|
|
- echo 'yarn-offline-mirror-pruning true' >> .yarnrc
|
|
|
|
- yarn install --frozen-lockfile --no-progress
|
|
|
|
|
|
|
|
# Install the dependencies for alpine
|
2023-07-08 12:22:58 +02:00
|
|
|
- apk update && apk add make graphviz zip
|
|
|
|
|
|
|
|
.deploy:
|
|
|
|
before_script:
|
|
|
|
# Install the dependencies for alpine
|
|
|
|
- apk update && apk add make openssh rsync
|
2023-07-08 12:08:27 +02:00
|
|
|
|
|
|
|
# Prepare environment for SSH
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- ln -s $SSH_CONFIG ~/.ssh/config
|
|
|
|
- ln -s $SSH_KEY ~/.ssh/id_ed25519
|
|
|
|
- ln -s $SSH_KNOWN_HOSTS ~/.ssh/known_hosts
|
|
|
|
- chmod 600 ~/.ssh/config ~/.ssh/id_ed25519 ~/.ssh/known_hosts
|
2023-07-08 11:48:36 +02:00
|
|
|
|
2023-07-08 12:22:58 +02:00
|
|
|
default:
|
|
|
|
image: node:current-alpine3.15
|
|
|
|
|
|
|
|
cache:
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- yarn.lock
|
|
|
|
paths:
|
|
|
|
- .yarn-cache/
|
|
|
|
|
2022-11-24 17:25:46 +01:00
|
|
|
stages:
|
2023-07-08 11:48:36 +02:00
|
|
|
- build
|
2022-11-24 17:25:46 +01:00
|
|
|
- deploy
|
|
|
|
|
2023-07-08 12:22:58 +02:00
|
|
|
build:poincare:
|
2023-07-08 11:48:36 +02:00
|
|
|
stage: build
|
|
|
|
|
2023-07-08 12:22:58 +02:00
|
|
|
extends: .build
|
|
|
|
|
2023-07-08 11:48:36 +02:00
|
|
|
script:
|
2023-07-08 12:08:27 +02:00
|
|
|
# Regenerate the static files
|
|
|
|
- make regenerate-dots
|
|
|
|
- make regenerate-zips
|
2023-07-08 11:48:36 +02:00
|
|
|
|
2023-07-08 12:22:58 +02:00
|
|
|
- URL="https://blog.mfocko.xyz" BASE_URL="/" yarn run build
|
2023-07-08 11:48:36 +02:00
|
|
|
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2023-07-08 12:08:27 +02:00
|
|
|
- "build/"
|
2023-07-08 11:48:36 +02:00
|
|
|
|
2023-07-08 12:22:58 +02:00
|
|
|
build:aisa:
|
|
|
|
stage: build
|
|
|
|
|
|
|
|
extends: .build
|
|
|
|
|
|
|
|
script:
|
|
|
|
# Regenerate the static files
|
|
|
|
- make regenerate-dots
|
|
|
|
- make regenerate-zips
|
|
|
|
|
|
|
|
- URL="https://fi.muni.cz" BASE_URL="~xfocko/kb/" yarn run build
|
|
|
|
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- "build/"
|
|
|
|
|
|
|
|
deploy:poincare:
|
2022-11-24 17:25:46 +01:00
|
|
|
stage: deploy
|
2023-07-08 12:25:28 +02:00
|
|
|
needs: [build:poincare]
|
2023-07-08 12:22:58 +02:00
|
|
|
|
|
|
|
extends: .deploy
|
2023-07-08 11:48:36 +02:00
|
|
|
|
2022-11-24 17:25:46 +01:00
|
|
|
script:
|
2023-07-08 12:22:58 +02:00
|
|
|
- rsync -avzrlpptv --delete build/ poincare:~/public_html/blog/
|
2023-07-08 11:48:36 +02:00
|
|
|
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2023-07-08 12:08:27 +02:00
|
|
|
- "build/"
|
2023-07-08 11:48:36 +02:00
|
|
|
|
|
|
|
only:
|
2023-07-08 12:08:27 +02:00
|
|
|
- main
|
2023-07-08 11:48:36 +02:00
|
|
|
|
2023-07-08 12:22:58 +02:00
|
|
|
deploy:aisa:
|
2023-07-08 11:48:36 +02:00
|
|
|
stage: deploy
|
2023-07-08 12:25:28 +02:00
|
|
|
needs: [build:aisa]
|
2023-07-08 12:22:58 +02:00
|
|
|
|
|
|
|
extends: .deploy
|
2023-07-08 11:48:36 +02:00
|
|
|
|
|
|
|
script:
|
2023-07-08 12:22:58 +02:00
|
|
|
- rsync -avzrlpptv --delete build/ aisa:~/public_html/kb/
|
2023-07-08 11:48:36 +02:00
|
|
|
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2023-07-08 12:08:27 +02:00
|
|
|
- "build/"
|
2023-07-08 11:48:36 +02:00
|
|
|
|
2022-11-24 17:25:46 +01:00
|
|
|
only:
|
2023-07-08 12:08:27 +02:00
|
|
|
- main
|