doc: First draft of users and rights management #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "analytics" | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- "commons/**" | |
- "analytics/**" | |
pull_request: | |
paths: | |
- "commons/**" | |
- "analytics/**" | |
jobs: | |
build: | |
if: "!startsWith(github.event.head_commit.message, '[skip ci] ')" | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: "Checking out" | |
uses: actions/checkout@v1 | |
- name: "Setting up Java" | |
uses: actions/setup-java@v4 | |
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,analytics -Dfmt.action=validate install -Dadditionalparam=-Xdoclint:none -DskipTests | |
- name: "Running tests" | |
working-directory: analytics/ | |
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: analytics/ | |
run: ../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/analytics:${{ steps.version.outputs.VERSION }} -DskipTests | |
- name: "Logging in docker.io" | |
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' | |
uses: azure/docker-login@v1 | |
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]' && github.event_name != 'pull_request' | |
run: | | |
docker tag georchestra/analytics:${{ steps.version.outputs.VERSION }} georchestra/analytics:latest | |
docker push georchestra/analytics:latest | |
- name: "Update Docker Hub Description" | |
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && 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/analytics | |
readme-filepath: ./analytics/DOCKER_HUB.md | |
short-description: 'Analytics module for the geOrchestra SDI' | |
- name: "Pushing release branch to docker.io" | |
if: contains(github.ref, 'refs/heads/24.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' | |
run: | | |
docker push georchestra/analytics:${{ steps.version.outputs.VERSION }} | |
- name: "Pushing release tag to docker.io" | |
if: contains(github.ref, 'refs/tags/24.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' | |
run: | | |
docker push georchestra/analytics:${{ steps.version.outputs.VERSION }} | |
- name: "Publish war in artifactory" | |
run: ./mvnw deploy --no-transfer-progress -B -P-all,analytics -DskipTests | |
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' | |
continue-on-error: true | |
env: | |
ARTIFACTORY_TOKEN_REF: ${{ secrets.ARTIFACTORY_TOKEN }} | |
ARTIFACTORY_USERNAME_REF: ${{ secrets.ARTIFACTORY_USERNAME }} | |
- name: "Remove SNAPSHOT jars from repository" | |
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' | |
run: | | |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {} |