clippable/.gitlab-ci.yml
2022-02-02 19:50:56 -08:00

73 lines
1.5 KiB
YAML

stages:
- pages
- build-frontend
- build-backend
- deploy
pages:
image: shockrah/website:latest
stage: pages
before_script:
- git submodule init
- git submodule update
script:
- cd gitpage
- hugo
- mv public/ ..
- ls ../public -R
artifacts:
paths:
- public/
build-frontend-js:
image: codesignal/typescript
stage: build-frontend
script:
- cd ts/
- npm run setup
- npm run build
artifacts:
paths:
- api/static/
# Literally both of these fail 99% of the time so I'm forgoing them completely
# for now until I find something doesn't suck
# Builds out the intended zip package
build-server-binaries:
image: rustlang/rust:nightly
stage: build-backend
script:
- mkdir -p build
- cp api/templates/ api/static/ build/ -r
- cd api/
- cargo build --release
- cd ../
- cp api/target/release/clippable-server build/server
- cp ./scripts/ build/ -r
- cp readme.md build/
- sh ./scripts/default-rocket-toml.sh
artifacts:
paths:
- build/
# Upload built docker image to the local registry
deploy-docker-image:
stage: deploy
image: docker:stable
only:
refs:
- master
needs:
- build-server-binaries
dependencies:
- build-server-binaries
services:
- docker:dind
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
- docker build -t registry.gitlab.com/shockrah/clippable .
- docker push registry.gitlab.com/shockrah/clippable