This repository was archived by the owner on Jul 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (68 loc) · 2.11 KB
/
api-artifact.yml
File metadata and controls
71 lines (68 loc) · 2.11 KB
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
name: SWE API PUBLISHER
on:
push:
branches:
- develop
jobs:
api_update:
runs-on: ubuntu-latest
steps:
- name: Checkout swe-kafka-db
uses: actions/checkout@v2
with:
repository: RedRoundRobin/swe-kafka-db
path: swe-kafka-db
ref: develop
persist-credentials: false
- name: Start databases
run: docker-compose -f swe-kafka-db/kafka/docker-compose.yml up -d
- name: Checkout swe-api
uses: actions/checkout@v2
with:
path: swe-api
fetch-depth: 0
persist-credentials: false
- name: Setup JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Generate API
run: mvn clean verify -Dspring.application.admin.enabled=true -Dsonar.login=${{ secrets.SONARCLOUD_LOGIN_KEY }} --file swe-api/apirest/pom.xml -e
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout api-docs
uses: actions/checkout@master
with:
repository: RedRoundRobin/api-docs
path: api-docs
persist-credentials: false
fetch-depth: 0
- name: Move new api in api-docs repo
run: mv swe-api/apirest/target/openapi.yaml api-docs/
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add openapi.yaml
git commit -m "[BOT] Aggiornata la documentazione API" -a
working-directory: api-docs
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN_ACTION }}
branch: master
directory: api-docs
repository: RedRoundRobin/api-docs
- name: Slack Notification
uses: homoluctus/slatify@v2.0.1
if: failure()
with:
type: ${{ job.status }}
job_name: 'Aggiornamento documentazione API'
mention: 'here'
mention_if: 'failure'
channel: '#devops_software'
username: 'API generator'
url: ${{ secrets.SLACK_SW_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}