generated from apereo/cas-overlay-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (48 loc) · 1.86 KB
/
main.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
name: build CAS
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
check-latest: true
- name: build the exploded CAS webapp
run: |
./gradlew explodeWarOnly
- name: Calculating the docker image tag
if: github.repository == 'georchestra/georchestra-cas-server'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Build a docker image
run: |
docker build -t georchestra/cas:latest .
- name: Build a war file
run: |
./gradlew build
- name: publish the artifact
if: github.repository == 'georchestra/georchestra-cas-server' && github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v1
with:
name: cas.war
path: build/libs/cas.war
- uses: docker/login-action@v1
if: github.repository == 'georchestra/georchestra-cas-server' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/'))
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Publish the docker image
if: github.repository == 'georchestra/georchestra-cas-server' && github.ref == 'refs/heads/master'
run: |
docker push georchestra/cas:latest
- name: Publish the docker image (release / tag)
if: contains(github.ref, 'refs/tags/') && github.repository == 'georchestra/georchestra-cas-server'
run: |
docker tag georchestra/cas:latest georchestra/cas:${{ steps.version.outputs.VERSION }}
docker push georchestra/cas:${{ steps.version.outputs.VERSION }}