-
Notifications
You must be signed in to change notification settings - Fork 8
78 lines (76 loc) · 2.65 KB
/
deploybeta.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
name: Test Build & Deploy beta
on:
push:
branches:
- '*'
- 'feature/*'
- 'refactor/*'
- 'release/*'
- '!master'
pull_request:
branches:
- '*'
- 'refactor/*'
- 'release/*'
- '!master'
jobs:
sonarbeta:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Analyze with SonarCloud
run: mvn -B verify sonar:sonar -Dsonar.projectKey=Mixeway_MixewayBackend -Dsonar.organization=mixeway -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# mixeway-scan:
# name: Mixeway Scanning
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v1
# - name: Prepare variables
# id: vars
# shell: bash
# run: |
# echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
# echo "::set-output name=sha_short::$(git rev-parse HEAD)"
# - name: Prepare Mixeway docker image
# run: |
# docker pull mixeway/scanner:latest
# - name: Run Scan
# run: |
# docker run -e MODE=STANDALONE -e OSS_USERNAME=${{ secrets.oss_username }} -e OSS_KEY=${{ secrets.oss_key }} -e COMMIT_ID=${{ steps.vars.outputs.sha_short }} -e BRANCH=${{ steps.vars.outputs.branch }} -e MIXEWAY_PROJECT_NAME=${{ github.event.repository.name }} -e MIXEWAY_PROJECT_ID=${{ secrets.mixeway_project_id }} -e MIXEWAY_KEY=${{ secrets.mixeway_key }} -v $PWD:/opt/sources mixeway/scanner:latest
integration-testing:
name: Integration test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '8'
- name: Java version
run: |
java -version
- name: Run tests
run: |
mvn test -Dspring.profiles.active=unittest
publishbeta:
runs-on: ubuntu-latest
needs: integration-testing
steps:
- uses: actions/checkout@v1
- name: Set Release version
run: |
echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: docker actions build & deploy
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
repository: mixeway/backend
tags: ${{ env.RELEASE_VERSION }}-beta