mirror of
https://github.com/mfocko/blog.git
synced 2024-11-22 13:03:47 +01:00
ci: deploy to GitLab Pages
Signed-off-by: Matej Focko <xfocko@fi.muni.cz>
This commit is contained in:
parent
622ac2463b
commit
81a1812dbf
1 changed files with 102 additions and 78 deletions
166
.gitlab-ci.yml
166
.gitlab-ci.yml
|
@ -1,26 +1,3 @@
|
||||||
.build:
|
|
||||||
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
|
|
||||||
- apk update && apk add make graphviz zip
|
|
||||||
|
|
||||||
.deploy:
|
|
||||||
before_script:
|
|
||||||
# Install the dependencies for alpine
|
|
||||||
- apk update && apk add make openssh rsync
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
default:
|
|
||||||
image: node:current-alpine3.15
|
image: node:current-alpine3.15
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
|
@ -30,70 +7,117 @@ default:
|
||||||
paths:
|
paths:
|
||||||
- .yarn-cache/
|
- .yarn-cache/
|
||||||
|
|
||||||
stages:
|
before_script:
|
||||||
- build
|
- echo 'yarn-offline-mirror ".yarn-cache/"' >> .yarnrc
|
||||||
- deploy
|
- echo 'yarn-offline-mirror-pruning true' >> .yarnrc
|
||||||
|
- yarn install --frozen-lockfile --no-progress
|
||||||
build:poincare:
|
- apk update && apk add make graphviz zip
|
||||||
stage: build
|
|
||||||
|
|
||||||
extends: .build
|
|
||||||
|
|
||||||
|
pages:
|
||||||
script:
|
script:
|
||||||
# Regenerate the static files
|
- make assets
|
||||||
- make regenerate-dots
|
- make build-poincare
|
||||||
- make regenerate-zips
|
|
||||||
|
|
||||||
- URL="https://blog.mfocko.xyz" BASE_URL="/" yarn run build
|
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- "build/"
|
- public
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
||||||
|
# .build:
|
||||||
|
# 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
|
||||||
|
|
||||||
build:aisa:
|
# # Install the dependencies for alpine
|
||||||
stage: build
|
# - apk update && apk add make graphviz zip
|
||||||
|
|
||||||
extends: .build
|
# .deploy:
|
||||||
|
# before_script:
|
||||||
|
# # Install the dependencies for alpine
|
||||||
|
# - apk update && apk add make openssh rsync
|
||||||
|
|
||||||
script:
|
# # Prepare environment for SSH
|
||||||
# Regenerate the static files
|
# - mkdir -p ~/.ssh
|
||||||
- make regenerate-dots
|
# - ln -s $SSH_CONFIG ~/.ssh/config
|
||||||
- make regenerate-zips
|
# - 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
|
||||||
|
|
||||||
- URL="https://fi.muni.cz" BASE_URL="~xfocko/kb/" yarn run build
|
# default:
|
||||||
|
# image: node:current-alpine3.15
|
||||||
|
|
||||||
artifacts:
|
# cache:
|
||||||
paths:
|
# key:
|
||||||
- "build/"
|
# files:
|
||||||
|
# - yarn.lock
|
||||||
|
# paths:
|
||||||
|
# - .yarn-cache/
|
||||||
|
|
||||||
deploy:poincare:
|
# stages:
|
||||||
stage: deploy
|
# - build
|
||||||
needs: [build:poincare]
|
# - deploy
|
||||||
|
|
||||||
extends: .deploy
|
# build:poincare:
|
||||||
|
# stage: build
|
||||||
|
|
||||||
script:
|
# extends: .build
|
||||||
- rsync -avzrlpptv --delete build/ poincare:~/public_html/blog/
|
|
||||||
|
|
||||||
artifacts:
|
# script:
|
||||||
paths:
|
# # Regenerate the static files
|
||||||
- "build/"
|
# - make regenerate-dots
|
||||||
|
# - make regenerate-zips
|
||||||
|
|
||||||
only:
|
# - URL="https://blog.mfocko.xyz" BASE_URL="/" yarn run build
|
||||||
- main
|
|
||||||
|
|
||||||
deploy:aisa:
|
# artifacts:
|
||||||
stage: deploy
|
# paths:
|
||||||
needs: [build:aisa]
|
# - "build/"
|
||||||
|
|
||||||
extends: .deploy
|
# build:aisa:
|
||||||
|
# stage: build
|
||||||
|
|
||||||
script:
|
# extends: .build
|
||||||
- rsync -avzrlpptv --delete build/ aisa:~/public_html/kb/
|
|
||||||
|
|
||||||
artifacts:
|
# script:
|
||||||
paths:
|
# # Regenerate the static files
|
||||||
- "build/"
|
# - make regenerate-dots
|
||||||
|
# - make regenerate-zips
|
||||||
|
|
||||||
only:
|
# - URL="https://fi.muni.cz" BASE_URL="~xfocko/kb/" yarn run build
|
||||||
- main
|
|
||||||
|
# artifacts:
|
||||||
|
# paths:
|
||||||
|
# - "build/"
|
||||||
|
|
||||||
|
# deploy:poincare:
|
||||||
|
# stage: deploy
|
||||||
|
# needs: [build:poincare]
|
||||||
|
|
||||||
|
# extends: .deploy
|
||||||
|
|
||||||
|
# script:
|
||||||
|
# - rsync -avzrlpptv --delete build/ poincare:~/public_html/blog/
|
||||||
|
|
||||||
|
# artifacts:
|
||||||
|
# paths:
|
||||||
|
# - "build/"
|
||||||
|
|
||||||
|
# only:
|
||||||
|
# - main
|
||||||
|
|
||||||
|
# deploy:aisa:
|
||||||
|
# stage: deploy
|
||||||
|
# needs: [build:aisa]
|
||||||
|
|
||||||
|
# extends: .deploy
|
||||||
|
|
||||||
|
# script:
|
||||||
|
# - rsync -avzrlpptv --delete build/ aisa:~/public_html/kb/
|
||||||
|
|
||||||
|
# artifacts:
|
||||||
|
# paths:
|
||||||
|
# - "build/"
|
||||||
|
|
||||||
|
# only:
|
||||||
|
# - main
|
||||||
|
|
Loading…
Reference in a new issue