80 lines
1.5 KiB
YAML
80 lines
1.5 KiB
YAML
stages:
|
|
- install
|
|
- build
|
|
- test
|
|
- deploy
|
|
|
|
variables:
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
|
|
|
install:
|
|
image: node:alpine
|
|
stage: install
|
|
cache:
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
paths:
|
|
- .npm
|
|
- .cache
|
|
script:
|
|
- npm ci --cache .npm --prefer-offline
|
|
artifacts:
|
|
name: '$CI_JOB_ID-node_modules'
|
|
paths:
|
|
- ./node_modules
|
|
expire_in: 30 mins
|
|
|
|
build:
|
|
image: archlinux
|
|
stage: build
|
|
before_script:
|
|
- pacman -Sy --noconfirm hugo git npm nodejs
|
|
script:
|
|
- ./scripts/release.sh
|
|
artifacts:
|
|
name: '$CI_JOB_ID-public'
|
|
paths:
|
|
- ./public
|
|
expire_in: 30 mins
|
|
|
|
test:
|
|
image: node:alpine
|
|
stage: test
|
|
dependencies:
|
|
- install
|
|
script:
|
|
- ./scripts/test.sh
|
|
|
|
deploy:
|
|
image: alpine
|
|
stage: deploy
|
|
dependencies:
|
|
- build
|
|
only:
|
|
- master
|
|
environment:
|
|
name: website
|
|
url: https://theorangeone.net
|
|
before_script:
|
|
- apk add --no-cache rclone
|
|
script:
|
|
- export RCLONE_CONFIG_PAGES_PASS=`rclone obscure $RCLONE_WEBDAV_PASSWORD`
|
|
- rclone sync -I -v public/ pages:theorangeone.net/
|
|
variables:
|
|
RCLONE_CONFIG_PAGES_TYPE: webdav
|
|
RCLONE_CONFIG_PAGES_URL: https://pages.theorangeone.net
|
|
RCLONE_CONFIG_PAGES_USER: github
|
|
|
|
container:
|
|
image: docker:stable
|
|
stage: deploy
|
|
dependencies:
|
|
- build
|
|
only:
|
|
- master
|
|
variables:
|
|
IMAGE_TAG: $CI_REGISTRY_IMAGE:latest
|
|
before_script:
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
script:
|
|
- docker build -f prod/Dockerfile -t $IMAGE_TAG .
|
|
- docker push $IMAGE_TAG
|