1
Fork 0
theorangeone.net-legacy/.gitlab-ci.yml
Jake Howard f12dd0c674
Use arch for site building
This lets me use the latest hugo version, which is the same as what I use locally.
2022-04-15 11:12:04 +01:00

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 -S --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