ci: add deploy stage and deploy to k8s staging environment
This commit is contained in:
parent
3ebc8f2637
commit
d803ba643f
1 changed files with 23 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ default:
|
|||
stages:
|
||||
- test
|
||||
- build
|
||||
- deploy
|
||||
|
||||
test:go:
|
||||
stage: test
|
||||
|
|
@ -58,3 +59,25 @@ build:migrations:
|
|||
- docker buildx create --name yggdrasil --use
|
||||
- docker buildx build --provenance=false --platform linux/amd64,linux/arm64 -t $IMAGE:$TAG -f build/package/migrations/Dockerfile --push .
|
||||
- docker manifest inspect $IMAGE:$TAG
|
||||
|
||||
deploy:staging:
|
||||
stage: deploy
|
||||
image: ghcr.io/vojtechmares/toolkit:latest
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "main"
|
||||
variables:
|
||||
TAG: $CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA
|
||||
NAMESPACE: yggdrasil-staging
|
||||
GIT_DEPTH: 1 # shallow clone
|
||||
environment:
|
||||
name: staging
|
||||
url: https://staging.yggdrasil.vmdevel.cz
|
||||
script:
|
||||
- >
|
||||
helm upgrade --install --namespace $NAMESPACE --create-namespace \
|
||||
api ./deploy \
|
||||
--values deploy/values.staging.yaml \
|
||||
--set image.tag=$TAG \
|
||||
--set imageCredentials.username=$REGISTRY_USERNAME \
|
||||
--set imageCredentials.password=$REGISTRY_PASSWORD \
|
||||
--set config.database.url=$DATABASE_URL
|
||||
|
|
|
|||
Reference in a new issue