-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (113 loc) · 3.78 KB
/
build.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
name: build VAuthenticator
on:
push: { }
workflow_dispatch:
inputs:
version:
description: 'make a tag'
required: false
type: string
newversion:
description: 'Next desired version'
required: false
type: string
jobs:
tag-artifact:
if: github.event.inputs.version != '' || github.event.inputs.version != ' '
needs:
- build-backend
- ui-backend
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: make an echo
run: |
echo version ${{github.event.inputs.version}}
- name: set the Tag version
run: |
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USERNAME }}"
mvn versions:set -DnewVersion=${{github.event.inputs.version}}
git commit -am "[skip-ci] new version release ${{github.event.inputs.version}}"
git push
- name: Create tag
uses: ncipollo/release-action@v1
with:
bodyFile: changelog/${{github.event.inputs.version}}.md
tag: ${{github.event.inputs.version}}
- name: set the Next Development version
run: |
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USERNAME }}"
mvn versions:set -DnewVersion=${{github.event.inputs.newversion}}
git commit -am "[skip-ci] new version release ${{github.event.inputs.newversion}}"
git push
build-backend:
runs-on: ubuntu-20.04
services:
localstack:
image: localstack/localstack:jvm-2022-11-03
ports:
- "4566-4599:4566-4599"
env:
SERVICES: s3,kms,dynamo
redis:
image: redis
ports:
- "6379:6379"
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'corretto'
- name: Build
run: |
mvn install -q
- name: docker push
run: |
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_PASSWORD }}
if [[ ${GITHUB_REF##*/} == 'master' ]]
then
DOCKER_TAG="latest"
else
DOCKER_TAG="${GITHUB_REF##*/}"
fi
echo "$DOCKER_TAG"
docker build . -t mrflick72/vauthenticator-k8s:$DOCKER_TAG
docker push mrflick72/vauthenticator-k8s:$DOCKER_TAG
- name: Docker tag
if: github.event.inputs.version != '' || github.event.inputs.version != ' '
run: |
DOCKER_TAG="${{github.event.inputs.version}}"
docker build . -t mrflick72/vauthenticator-k8s:$DOCKER_TAG
docker push mrflick72/vauthenticator-k8s:$DOCKER_TAG
ui-backend:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: install node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Build frontend artifacts
run: |
cd src/main/frontend
npm install --legacy-peer-deps
npm run-script production-build
- name: load static file on s3
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- run: |
cd src/main/frontend/dist/asset
ls *.js | while read line
do
aws s3 cp $line s3://${{ secrets.VAUTHENTICATOR_BUCKET }}/static-asset/content/asset/$line
done