-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
39 lines (33 loc) · 1.1 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
variables:
OBJECTS_DIRECTORY: 'obj'
NUGET_PACKAGES_DIRECTORY: '.nuget'
SOURCE_CODE_PATH: 'Friday'
BUILD_OUTPUT_PATH: 'Friday/bin/Release/net6.0/'
GIT_SUBMODULE_STRATEGY: recursive
# ### Define global cache rule
#
# Before building the project, all dependencies (e.g. third-party NuGet packages)
# must be restored. Jobs on GitLab.com's Shared Runners are executed on autoscaled machines.
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- '$SOURCE_CODE_PATH$OBJECTS_DIRECTORY/project.assets.json'
- '$SOURCE_CODE_PATH$OBJECTS_DIRECTORY/*.csproj.nuget.*'
- '$BUILD_OUTPUT_PATH'
policy: pull-push
stages:
- publish
publish:image:
image: docker:latest
stage: publish
only:
- master
tags: ["build", "docker"]
services:
- docker:dind
before_script:
- echo "$HARBOR_PASS" | docker login -u "$HARBOR_USER" "$HARBOR_URL" --password-stdin
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:latest" .
- docker tag $CI_REGISTRY_IMAGE:latest $HARBOR_HOST/$HARBOR_PROJECT/$CI_REGISTRY_IMAGE:latest
- docker push "$HARBOR_HOST/$HARBOR_PROJECT/$CI_REGISTRY_IMAGE:latest"