Create Docker base template

This commit is contained in:
Ethan Girouard 2024-03-26 16:19:31 -04:00
parent 126ee5c366
commit 5e2b41da5d
Signed by: eta357
GPG Key ID: 7BCDC36DFD11C146

View File

@ -5,16 +5,20 @@ build:
script: script:
- cargo-leptos build - cargo-leptos build
# Build the docker image and push it to the registry .docker:
docker-build:
needs: ["build"]
image: docker:latest image: docker:latest
services: services:
- docker:dind - docker:dind
tags: tags:
- docker - docker
script: before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# Build the docker image and push it to the registry
docker-build:
needs: ["build"]
extends: .docker
script:
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA . - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA .
# If running on the default branch, tag as latest # If running on the default branch, tag as latest
- if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then docker tag - if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then docker tag