Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
f11h committed Apr 27, 2021
1 parent 7c2f4cd commit 4e3dcf9
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI Main Branch
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- uses: s4u/[email protected]
with:
githubServer: false
servers: |
[
{
"id": "dgc-github",
"username": "${{ secrets.GPR_USER }}",
"password": "${{ secrets.GPR_PAT }}"
},
{
"id": "ehd-github",
"username": "${{ secrets.GPR_USER }}",
"password": "${{ secrets.GPR_PAT }}"
}
]
- name: Build
run: mvn install
- name: Build for Docker Image
run: mvn clean install -P docker
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Build Docker Image
run: docker build target/docker --file target/docker/Dockerfile --tag docker.pkg.github.com/${{ github.repository }}/backend:latest
- name: Push Docker Image
run: docker push docker.pkg.github.com/${{ github.repository }}/backend:latest
36 changes: 36 additions & 0 deletions .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ci-pull-request
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- uses: s4u/maven-settings-action@v2
with:
githubServer: false
servers: |
[
{
"id": "dgc-github",
"username": "${{ secrets.GPR_USER }}",
"password": "${{ secrets.GPR_PAT }}"
},
{
"id": "ehd-github",
"username": "${{ secrets.GPR_USER }}",
"password": "${{ secrets.GPR_PAT }}"
}
]
- name: Build package
run: mvn --batch-mode package
18 changes: 18 additions & 0 deletions .github/workflows/ci-release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: ci-release-notes
on:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: release notes
run: |
TAG=${GITHUB_REF/refs\/tags\/}
npx github-release-notes release --override --tags ${TAG}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GREN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

45 changes: 45 additions & 0 deletions .github/workflows/ci-sonar-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Sonar Cloud Check
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Git
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- uses: s4u/maven-settings-action@v2
with:
githubServer: false
servers: |
[
{
"id": "dgc-github",
"username": "${{ secrets.GPR_USER }}",
"password": "${{ secrets.GPR_PAT }}"
},
{
"id": "ehd-github",
"username": "${{ secrets.GPR_USER }}",
"password": "${{ secrets.GPR_PAT }}"
}
]
- name: Sonar Check
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 4e3dcf9

Please sign in to comment.