mirror of
https://mau.dev/andreijiroh-dev/website.git
synced 2024-11-22 00:13:40 +00:00
fix(gitlab-ci): 💚 fix issue relating to container entrypoint stuff
Also in this commit, we improved the build script to use the virtualenv setup we did to isolate dependencies from the rest of the build system. We also did some adjustments on caching deps to speed up the CI. Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>
This commit is contained in:
parent
3b92600c23
commit
eab9ae94a6
2 changed files with 32 additions and 17 deletions
|
@ -1,9 +1,8 @@
|
|||
image:
|
||||
name: dock.mau.dev/ajhalili2006/tildeverse-web/build-ci
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- sh
|
||||
|
||||
.build-configs:
|
||||
variables:
|
||||
FF_ENABLE_COMMIT_DATA: "true"
|
||||
FF_GENERATE_SOCIAL_CARDS: "true"
|
||||
|
@ -11,9 +10,9 @@ image:
|
|||
|
||||
.setupkit:
|
||||
before_script:
|
||||
- apk add curl gnupg
|
||||
- apk add curl gnupg bash coreutils
|
||||
- curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
|
||||
- (curl -Ls --tlsv1.2 --proto "=https" --retry 3 https://cli.doppler.com/install.sh || wget -t 3 -qO- https://cli.doppler.com/install.sh) | sudo sh
|
||||
- (curl -Ls --tlsv1.2 --proto "=https" --retry 3 https://cli.doppler.com/install.sh || wget -t 3 -qO- https://cli.doppler.com/install.sh) | sh
|
||||
|
||||
stages:
|
||||
- build
|
||||
|
@ -21,19 +20,20 @@ stages:
|
|||
- deploy
|
||||
|
||||
build:main:
|
||||
extends: [ .build-configs ]
|
||||
extends: [ .setupkit ]
|
||||
stage: build
|
||||
script:
|
||||
- mkdocs build
|
||||
- bash ./build.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
untracked: false
|
||||
when: on_success
|
||||
expire_in: "30 days"
|
||||
expire_in: "21 days"
|
||||
cache:
|
||||
paths:
|
||||
- .cache
|
||||
- .venv
|
||||
key: pages-build-main
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == 'main'
|
||||
|
@ -44,10 +44,20 @@ build:main:
|
|||
|
||||
deploy:main:
|
||||
stage: deploy
|
||||
extends: [ .setupkit, .build-configs ]
|
||||
extends: [ .setupkit ]
|
||||
needs:
|
||||
- build:main
|
||||
script:
|
||||
- apk add nodejs-lts npm
|
||||
- apk add nodejs-lts npm && npm i
|
||||
- ls -Al
|
||||
- doppler run -- echo hi
|
||||
cache:
|
||||
paths:
|
||||
- node_modules
|
||||
key: deploykit-main
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == 'main'
|
||||
changes:
|
||||
- mkdocs.yml
|
||||
- markdown/*
|
||||
- markdown/**/*
|
11
build.sh
11
build.sh
|
@ -1,10 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
set -xe
|
||||
|
||||
TARGET_DIR=${TARGET_DIR:-"$HOME/public_html"}
|
||||
TARGET_DIR=${TARGET_DIR:-"$PWD/public"}
|
||||
FF_OFFLINE_MKDOCS_PLUGIN=${FF_OFFLINE_MKDOCS_PLUGIN:-"false"}
|
||||
FF_ENABLE_COMMIT_DATA=${FF_ENABLE_COMMIT_DATA:-"true"}
|
||||
FF_GENERATE_SOCIAL_CARDS=${FF_GENERATE_SOCIAL_CARDS:-"true"}
|
||||
|
||||
pip3 install -r requirements.txt --user
|
||||
mkdocs build -d $TARGET_DIR
|
||||
if [[ ! -d "$PWD/.venv" ]]; then
|
||||
python3 -m venv $PWD/.venv
|
||||
fi
|
||||
$PWD/.venv/bin/pip3 install -r requirements.txt --upgrade
|
||||
$PWD/.venv/bin/mkdocs build -d $TARGET_DIR
|
||||
|
||||
set +xe
|
||||
|
|
Loading…
Reference in a new issue