Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

implement docker build on tags (#542)

Thomas Kaul76dbf7827990
diff --git a/.travis.yml b/.travis.yml
index 57b8bdfe4d..743e9308d4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,9 +3,28 @@ git:
depth: false
node_js:
- 14
-before_script:
- - yarn
-script:
- - yarn format:check
- - yarn test
- - yarn build:all
+
+services:
+ - docker
+
+cache: yarn
+
+if: (type = pull_request) OR (tag IS present)
+
+jobs:
+ include:
+ - stage: download dependencies
+ if: type = pull_request
+ script: yarn --frozen-lockfile
+ - stage: check formatting
+ if: type = pull_request
+ script: yarn format:check
+ - stage: execute tests
+ if: type = pull_request
+ script: yarn test
+ - stage: build
+ if: type = pull_request
+ script: yarn build:all
+ - stage: build and push docker images
+ if: tag IS present
+ script: ./publish-docker-image.sh
diff --git a/publish-docker-image.sh b/publish-docker-image.sh
new file mode 100755
index 0000000000..310ffb49b6
--- /dev/null
+++ b/publish-docker-image.sh
@@ -0,0 +1,5 @@
+set -xe
+echo "$DOCKER_HUB_ACCESS_TOKEN" | docker login -u "$DOCKER_HUB_USERNAME" --password-stdin
+
+docker build -t ghostfolio/ghostfolio:$TRAVIS_TAG .
+docker push ghostfolio/ghostfolio:$TRAVIS_TAG