-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (71 loc) · 2.72 KB
/
develop.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
# Description
# -----------
# This workflow is intended to run anytime there is a push on a `develop` branch.
name: Develop Branch
on:
push:
branches:
- develop*
workflow_dispatch:
env:
TZ: America/Indianapolis
jobs:
deploy:
if: ( github.event_name == 'workflow_dispatch' || github.event_name == 'push' ) && startsWith(github.ref, 'refs/heads/develop')
name: Verify and Deploy Maven Project
runs-on: [ Linux ]
container:
image: registry.docker.iu.edu/eshr-architecture/ess-build:latest
credentials:
username: ${{ secrets.ESHR_REGISTRY_USERNAME }}
password: ${{ secrets.ESHR_REGISTRY_PASSWORD }}
volumes:
- /opt/actions/cache/m2/repository:/root/.m2/repository
steps:
- name: Clone GitHub repository
uses: actions/checkout@v3
- name: Generate build time configuration
env:
ESSBUILD_VAULT_APPROLE_ROLE_ID_UNT: ${{ secrets.ESSBUILD_VAULT_APPROLE_ROLE_ID_UNT }}
ESSBUILD_VAULT_APPROLE_SECRET_ID_UNT: ${{ secrets.ESSBUILD_VAULT_APPROLE_SECRET_ID_UNT }}
ESSBUILD_VAULT_APPROLE_ROLE_ID_STG: ${{ secrets.ESSBUILD_VAULT_APPROLE_ROLE_ID_STG }}
ESSBUILD_VAULT_APPROLE_SECRET_ID_STG: ${{ secrets.ESSBUILD_VAULT_APPROLE_SECRET_ID_STG }}
ESSBUILD_VAULT_APPROLE_ROLE_ID_REG: ${{ secrets.ESSBUILD_VAULT_APPROLE_ROLE_ID_REG }}
ESSBUILD_VAULT_APPROLE_SECRET_ID_REG: ${{ secrets.ESSBUILD_VAULT_APPROLE_SECRET_ID_REG }}
run: |
generate_build_properties
generate_deploy_properties
- name: Compile, Verify, and Build Javadoc
id: verify
run: |
mvn clean verify -U --batch-mode
- name: Deploy Artifacts
run: |
mvn deploy -DskipTests --batch-mode
- name: Publish Documentation
if: steps.verify.outcome == 'success'
run: |
git config --global --add safe.directory $PWD
if (git fetch origin github_pages)
then
git checkout github_pages
else
git checkout -b github_pages
git push --set-upstream origin github_pages
fi
git pull
rm -rf docs/$GITHUB_REF_NAME
mkdir -p docs/$GITHUB_REF_NAME
for a in $(find -type d -regex '.*/\(apidocs\|jacoco\(-aggregate\)?\)' | cut -b3- | egrep -v '^docs/')
do
t=docs/$GITHUB_REF_NAME/${a%%target*}
mkdir -p $t
mv $a $t
done
if (git add docs && git commit --dry-run)
then
git config user.name eshrastg
git config user.email [email protected]
git commit -m "publish $GITHUB_ACTOR $GITHUB_REF_NAME"
git push
fi