Last active
October 17, 2023 15:34
-
-
Save adnan-kamili/8259b13be0b376cc444424668056cf51 to your computer and use it in GitHub Desktop.
asp.net-core-gitlab-heroku
This file contains 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
# Official docker image. | |
image: docker:latest | |
services: | |
- docker:dind | |
variables: | |
DOCKER_DRIVER: overlay | |
before_script: | |
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY | |
- apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community nodejs-npm | |
- npm i -g heroku | |
deploy-develop: | |
stage: deploy | |
script: | |
- docker run -t -v $PWD:/app --workdir /app mcr.microsoft.com/dotnet/core/sdk:2.2 bash -c "dotnet restore && dotnet publish -c Release -o ./bin/Release/PublishOutput" | |
- docker build -t $CI_REGISTRY/my-awesome-app-dev/web . | |
- docker push $CI_REGISTRY/my-awesome-app-dev/web | |
# above two commands can be replaced with: "heroku container:push web --app my-awesome-app-dev" | |
- heroku container:release web --app my-awesome-app-dev | |
only: | |
- develop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment