Skip to content

Merge pull request #13 from georchestra/upgrade-to-cas-6.6 #154

Merge pull request #13 from georchestra/upgrade-to-cas-6.6

Merge pull request #13 from georchestra/upgrade-to-cas-6.6 #154

Workflow file for this run

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: '17'
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: "Update Docker Hub Description"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra-cas-server' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
repository: georchestra/cas
readme-filepath: ./DOCKER_HUB.md
short-description: 'Cas module for the geOrchestra SDI'
- 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 }}