Skip to content

Merge pull request #146 from georchestra/better-default-logs #189

Merge pull request #146 from georchestra/better-default-logs

Merge pull request #146 from georchestra/better-default-logs #189

Workflow file for this run

name: "Build and publish docker image"
on:
workflow_dispatch:
push:
branches:
- main
- '1.*'
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: "Checking out"
uses: actions/checkout@v3
with:
submodules: 'true'
- name: "Setting up Java"
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '21'
cache: 'maven'
- name: "Build gateway"
run: make install test
- name: Getting image tag
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: "Build docker image"
if: github.repository == 'georchestra/georchestra-gateway'
run: make docker
- name: "Log in to docker.io"
if: github.repository == 'georchestra/georchestra-gateway'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'
- name: "Push latest to docker.io"
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
run: docker push georchestra/gateway:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/1.') && github.repository == 'georchestra/georchestra-gateway' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
run: |
docker tag georchestra/gateway:latest georchestra/gateway:${{ steps.version.outputs.VERSION }}
docker push georchestra/gateway:${{ steps.version.outputs.VERSION }}
- name: "Push tagged image to docker.io"
if: github.ref_type == 'tag' && github.ref != 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
run: docker push georchestra/gateway:${{ steps.version.outputs.VERSION }}
- name: "Update Gateway Docker Hub Description"
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway' && 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/gateway
readme-filepath: ./DOCKER_HUB.md
short-description: 'Gateway module for the geOrchestra SDI'
- name: Login to GitHub Container Registry
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Push image attached to commit id to ghcr.io"
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway'
run: |
docker tag georchestra/gateway:latest ghcr.io/georchestra/georchestra-gateway/gateway:commit-${{ github.sha }}
docker push ghcr.io/georchestra/georchestra-gateway/gateway:commit-${{ github.sha }}
- name: "Remove SNAPSHOT jars from repository"
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}