forked from ease-crc/soma
-
Notifications
You must be signed in to change notification settings - Fork 1
152 lines (131 loc) · 4.76 KB
/
deployment.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Deployment
on:
push:
branches:
- master
paths:
- '**'
release:
branches:
- master
types: [created]
paths:
- '**'
jobs:
deployment:
name: Deployment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '18'
cache: 'maven'
- name: Create directories
run: |
mkdir -p $GITHUB_WORKSPACE/build/owl/current &&
mkdir mkdir -p $GITHUB_WORKSPACE/build/files
- name: Compile current
if: startsWith(github.ref, 'refs/tags/') != true
run: |
mvn spring-boot:run -f scripts/java/pom.xml \
-Dspring-boot.run.arguments="--versionInfo=current"
- name: Compile tag
if: startsWith(github.ref, 'refs/tags/')
run: |
mvn spring-boot:run -f scripts/java/pom.xml \
-Dspring-boot.run.arguments="--versionInfo=${{ github.event.release.tag_name }}"
- name: Upload SOMA
uses: actions/upload-artifact@v1
with:
name: SOMA Ontology
path: ./build/owl/current/SOMA.owl
- name: Upload SOMA-HOME
uses: actions/upload-artifact@v1
with:
name: SOMA-HOME Ontology
path: ./build/owl/current/SOMA-HOME.owl
- name: Upload DUL
uses: actions/upload-artifact@v1
with:
name: DUL Ontology
path: ./owl/DUL.owl
- name: Copy all OWL files to be deployed
run: sudo cp -n ./owl/*.owl $GITHUB_WORKSPACE/build/owl/current
- name: Compile NEEM Handbook
uses: docker://blang/latex:ubuntu
with:
args: make -f ./docs/NEEM-handbook/Makefile
- name: Copy NEEM Handbook
run: sudo cp $GITHUB_WORKSPACE/docs/NEEM-handbook/main.pdf $GITHUB_WORKSPACE/build/files/NEEM-Handbook.pdf
- name: Deploy files current
uses: JamesIves/github-pages-deploy-action@releases/v3
if: github.ref == 'refs/heads/master'
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: build/files
TARGET_FOLDER: /files/current
- name: Deploy owl current
uses: JamesIves/github-pages-deploy-action@releases/v3
if: github.ref == 'refs/heads/master'
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: build/owl/current/
TARGET_FOLDER: /owl/current
- name: Deploy owl tag
uses: JamesIves/github-pages-deploy-action@releases/v3
if: startsWith(github.ref, 'refs/tags/')
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: build/owl/current/
TARGET_FOLDER: owl/${{ github.event.release.tag_name }}
#TARGET_FOLDER: owl/${{ GITHUB_REF/refs\/tags\// }}
#TARGET_FOLDER: owl/${{ GITHUB_REF#refs/tags/ }}
# Metrics have to be created after the deployment step, because
# OntoMetrics only allows POST with an URI at the moment
- name: Metrics
if: github.ref == 'refs/heads/master'
run: |
sudo ./scripts/OntoMetrics.sh \
https://raw.githubusercontent.com/ease-crc/soma/gh-pages/owl/current/SOMA.owl \
$GITHUB_WORKSPACE/build/files
- name: Metrics
if: startsWith(github.ref, 'refs/tags/')
run: |
sudo ./scripts/OntoMetrics.sh \
https://raw.githubusercontent.com/ease-crc/soma/gh-pages/owl/${{ github.event.release.tag_name }}/SOMA.owl \
$GITHUB_WORKSPACE/build/files
- name: Upload Metrics
uses: actions/upload-artifact@v1
with:
name: Metrics
path: ./build/files/metrics.json
- name: Deploy files current
uses: JamesIves/github-pages-deploy-action@releases/v3
if: github.ref == 'refs/heads/master'
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: build/files
TARGET_FOLDER: /files/current
- name: Deploy files tag
uses: JamesIves/github-pages-deploy-action@releases/v3
if: startsWith(github.ref, 'refs/tags/')
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: build/files/
TARGET_FOLDER: files/${{ github.event.release.tag_name }}
#TARGET_FOLDER: owl/${{ GITHUB_REF/refs\/tags\// }}
#TARGET_FOLDER: owl/${{ GITHUB_REF#refs/tags/ }}
- name: Deploy failure
if: failure()
run: echo Deployment failed. If the other steps succeeded, maybe no ACCESS_TOKEN was set?