-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (73 loc) · 2.91 KB
/
ci-cd.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# CI-CD
# Runs on push to master
name: CI-CD
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build docker stack
run: |
docker network create traefik
docker-compose -f docker-compose.yml -f docker-compose.test.yml up run-tests
# This workflow contains a single job called "build"
build-and-deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: test
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker images
# You may pin to the exact commit or the version.
# uses: docker/build-push-action@0db984c1826869dcd0740ff26ff75ff543238fd9
uses: docker/build-push-action@v2.2.1
with:
tags: # optional
fotogjengen/hilfling-backend:latest
push: true #optional, default is false
- name: "Package app outside docker"
run: "mvn clean package spring-boot:repackage"
- name: "Publish package to Github Releases"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: ./target/*
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run ktlint with reviewdog
# You may pin to the exact commit or the version.
# uses: ScaCap/action-ktlint@58b3c386f5160049b0a1d0f986c56e0d0717140a
uses: ScaCap/action-ktlint@1.3
with:
# GITHUB_TOKEN
github_token: ${{ secrets.GITHUB_TOKEN }}
# Report level for reviewdog [info,warning,error]
level: error# optional, default is error
# Reporter of reviewdog command [github-pr-check,github-pr-review].
reporter: github-pr-check # optional, default is github-pr-check
# Fails the current check if any error was found [true/false]
fail_on_error: false # optional, default is false
# Print files relative to the working directory
relative: true # optional, default is true
# Run KtLint with Android Kotlin Style Guide