39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
# Build the project
|
|
build:
|
|
needs: []
|
|
image: registry.mregirouard.com/libretunes/ops/docker-leptos:slim
|
|
script:
|
|
- cargo-leptos build
|
|
|
|
# Build the docker image and push it to the registry
|
|
docker-build:
|
|
needs: ["build"]
|
|
image: docker:latest
|
|
script:
|
|
- /usr/local/bin/dockerd-entrypoint.sh &
|
|
- while ! docker info; do echo "Waiting for Docker to become available..."; sleep 1; done
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD registry.mregirouard.com
|
|
- docker build -t registry.mregirouard.com/libretunes/libretunes:$CI_COMMIT_SHORT_SHA .
|
|
# If running on the default branch, tag as latest
|
|
- if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then docker tag
|
|
registry.mregirouard.com/libretunes/libretunes:$CI_COMMIT_SHORT_SHA
|
|
registry.mregirouard.com/libretunes/libretunes:latest; fi
|
|
- docker push registry.mregirouard.com/libretunes/libretunes --all-tags
|
|
|
|
# Run unit tests
|
|
test:
|
|
needs: ["build"]
|
|
image: registry.mregirouard.com/libretunes/ops/docker-leptos:slim
|
|
script:
|
|
- cargo-leptos test
|
|
|
|
# Generate docs
|
|
cargo-doc:
|
|
needs: []
|
|
image: rust:slim
|
|
script:
|
|
- cargo doc --no-deps
|
|
artifacts:
|
|
paths:
|
|
- target/doc
|