mirror of
https://mau.dev/andreijiroh-dev/website.git
synced 2025-06-07 13:09:32 +00:00
Move website builds to GitLab CI
Repo cloning will go by next week. Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>
This commit is contained in:
parent
4ae868cf37
commit
9e61cf7e65
6 changed files with 88 additions and 222 deletions
102
.gitlab-ci.yml
102
.gitlab-ci.yml
|
@ -1,7 +1,12 @@
|
|||
image:
|
||||
name: dock.mau.dev/ajhalili2006/tildeverse-web/build-ci:commit-a9761cf4f2f1b8298f69aaaa07e0a577329a17d6
|
||||
entrypoint:
|
||||
- /bin/bash
|
||||
# The Docker image that will be used to build your app
|
||||
image: quay.io/ajhalili2006/mkdocs-material-build-ci
|
||||
|
||||
# Functions that should be executed before the build script is run
|
||||
before_script:
|
||||
- pip3 install -r requirements.txt
|
||||
- npm ci
|
||||
- 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) | sh
|
||||
|
||||
variables:
|
||||
DEBUG: "1"
|
||||
|
@ -9,93 +14,14 @@ variables:
|
|||
FF_GENERATE_SOCIAL_CARDS: "true"
|
||||
SECURE_FILES_DOWNLOAD_PATH: /run/secrets
|
||||
|
||||
.setupkit:
|
||||
before_script:
|
||||
- apk add curl gnupg bash coreutils && mkdir /run/secrets
|
||||
- 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) | sh
|
||||
tags:
|
||||
- amd64
|
||||
|
||||
stages:
|
||||
- build
|
||||
- lint
|
||||
- deploy
|
||||
|
||||
build:mr:
|
||||
extends: [ .setupkit ]
|
||||
stage: build
|
||||
script:
|
||||
- bash ./bin/build.sh
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
untracked: false
|
||||
when: on_success
|
||||
expire_in: "21 days"
|
||||
cache:
|
||||
paths:
|
||||
- .cache
|
||||
- .venv
|
||||
key: pages-build-main
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH != 'main' && $CI_PIPELINE_SOURCE == "merge_request"
|
||||
changes:
|
||||
- mkdocs.yml
|
||||
- markdown/*
|
||||
- markdown/**/*
|
||||
- .gitlab-ci.yml
|
||||
- docker/Dockerfile
|
||||
- package*.json
|
||||
- .trigger-deploy
|
||||
|
||||
build:main:
|
||||
extends: [ .setupkit ]
|
||||
stage: build
|
||||
pages:
|
||||
script:
|
||||
- bash ./build.sh
|
||||
artifacts:
|
||||
paths:
|
||||
# The folder that contains the files to be exposed at the Page URL
|
||||
- public
|
||||
untracked: false
|
||||
when: on_success
|
||||
expire_in: "21 days"
|
||||
cache:
|
||||
paths:
|
||||
- .cache
|
||||
- .venv
|
||||
key: pages-build-main
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == 'main'
|
||||
changes:
|
||||
- mkdocs.yml
|
||||
- markdown/*
|
||||
- markdown/**/*
|
||||
- .gitlab-ci.yml
|
||||
- docker/Dockerfile
|
||||
- package*.json
|
||||
- .trigger-deploy
|
||||
|
||||
deploy:main:
|
||||
stage: deploy
|
||||
extends: [ .setupkit ]
|
||||
needs:
|
||||
- build:main
|
||||
script:
|
||||
- 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/**/*
|
||||
- .gitlab-ci.yml
|
||||
- docker/Dockerfile
|
||||
- package*.json
|
||||
- .trigger-deploy
|
||||
# This ensures that only pushes to the default branch will trigger
|
||||
# a pages deploy
|
||||
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue