Created
July 30, 2023 14:42
-
-
Save farhadnowzari/f29890a4b74f0b8c947adf1c76dd7011 to your computer and use it in GitHub Desktop.
gitlab ci sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: mcr.microsoft.com/dotnet/sdk:6.0 | |
variables: | |
PACKAGE_VERSION: 1.0.0 | |
IMAGE_TAG: saga-service:$PACKAGE_VERSION | |
stages: | |
- build | |
- publish | |
build_backend: | |
stage: build | |
script: | |
- echo "Compiling..." | |
- dotnet build -c Release | |
- dotnet publish -c Release | |
artifacts: | |
untracked: true | |
when: on_success | |
paths: | |
- "bin/Release/net6.0/" | |
expire_in: "1 day" | |
publish_container: | |
image: docker:20.10.16 | |
stage: publish | |
dependencies: | |
- build_backend | |
variables: | |
DOCKER_HOST: tcp://docker:2376 | |
DOCKER_TLS_CERTDIR: "/certs" | |
DOCKER_TLS_VERIFY: 1 | |
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client" | |
services: | |
- docker:20.10.16-dind | |
script: | |
- echo "Deploying..." | |
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY | |
- docker build -t $CI_REGISTRY/nowzarifarhad/sagaorchestrator/$IMAGE_TAG . | |
- docker push $CI_REGISTRY/nowzarifarhad/sagaorchestrator/$IMAGE_TAG | |
only: | |
- main | |
- dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment