Skip to content

Merge pull request #4333 from georchestra/backport/23.0.x/pr-4331 #9

Merge pull request #4333 from georchestra/backport/23.0.x/pr-4331

Merge pull request #4333 from georchestra/backport/23.0.x/pr-4331 #9

Workflow file for this run

name: "header"
on:
workflow_dispatch:
push:
paths:
- "commons/**"
- "header/**"
pull_request:
paths:
- "commons/**"
- "header/**"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "Checking out"
uses: actions/checkout@v1
- name: "Setting up Java"
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
server-id: geOrchestra-artifactory
server-username: ARTIFACTORY_USERNAME_REF
server-password: ARTIFACTORY_TOKEN_REF
- name: "Installing & checking formatting"
run: ./mvnw --no-transfer-progress -B -P-all,header -Dfmt.action=validate install -Dadditionalparam=-Xdoclint:none -DskipTests
- name: "Running tests"
working-directory: header/
run: ../mvnw --no-transfer-progress clean verify -Pit -Dfmt.skip=true -Dadditionalparam=-Xdoclint:none
- name: Getting image tag
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: "Building docker image"
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
working-directory: header/
run: ../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/header:${{ steps.version.outputs.VERSION }} -DskipTests
- name: "Logging in docker.io"
uses: azure/docker-login@v1
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'
- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker tag georchestra/header:${{ steps.version.outputs.VERSION }} georchestra/header:latest
docker push georchestra/header:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/23.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/header:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/23.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/header:${{ steps.version.outputs.VERSION }}
- name: "Publish war in artifactory"
run: ./mvnw deploy --no-transfer-progress -B -P-all,header -DskipTests
continue-on-error: true
env:
ARTIFACTORY_TOKEN_REF: ${{ secrets.ARTIFACTORY_TOKEN }}
ARTIFACTORY_USERNAME_REF: ${{ secrets.ARTIFACTORY_USERNAME }}
- name: "Remove SNAPSHOT jars from repository"
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}