ci: refactor
This commit is contained in:
parent
4fbb5f72dc
commit
c230b9690a
1 changed files with 31 additions and 13 deletions
|
@ -2,27 +2,45 @@ image: alpine:latest
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
HUGO_VERSION: 0.79.0
|
HUGO_VERSION: 0.79.0
|
||||||
|
FOLDER: "public"
|
||||||
|
OBJECT_STORE_ENDPOINT: "hot-objects.liiib.re"
|
||||||
BUCKET: libre-sh-scim-doc
|
BUCKET: libre-sh-scim-doc
|
||||||
BETA_BUCKET: libre-sh-scim-doc-beta
|
BETA_BUCKET: libre-sh-scim-doc-beta
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
before_script:
|
workflow:
|
||||||
- apk add --no-cache wget ca-certificates
|
rules:
|
||||||
- wget -O hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz
|
- if: "$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
|
||||||
- tar xzf hugo.tar.gz hugo
|
variables:
|
||||||
- apk add --no-cache nodejs-current npm
|
MC_HOST_hot: https://${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}@${OBJECT_STORE_ENDPOINT}
|
||||||
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||||
|
variables:
|
||||||
|
MC_HOST_hot: https://${BETA_AWS_ACCESS_KEY_ID}:${BETA_AWS_SECRET_ACCESS_KEY}@${OBJECT_STORE_ENDPOINT}
|
||||||
|
BUCKET: ${BETA_BUCKET}
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
before_script:
|
||||||
- ./hugo --minify
|
- apk add --no-cache wget ca-certificates
|
||||||
|
- wget -O hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz
|
||||||
|
- tar xzf hugo.tar.gz hugo
|
||||||
|
- apk add --no-cache nodejs-current npm
|
||||||
|
script: ./hugo --minify
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
|
||||||
include:
|
deploy:
|
||||||
- remote: 'https://lab.libreho.st/libre.sh/pipelines/-/raw/main/mirror_folder_to_s3.yml'
|
stage: deploy
|
||||||
|
rules:
|
||||||
|
- if: "$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
|
||||||
|
when: on_success
|
||||||
|
- when: manual
|
||||||
|
needs: ["build"]
|
||||||
|
image:
|
||||||
|
name: minio/mc
|
||||||
|
entrypoint: [""]
|
||||||
|
script: mc mirror --overwrite --remove ${FOLDER} hot/${BUCKET}
|
||||||
|
|
Loading…
Reference in a new issue