Skip to content

✨ (#220): Add endpoint to get my org #292

✨ (#220): Add endpoint to get my org

✨ (#220): Add endpoint to get my org #292

Workflow file for this run

name: backend
on:
push:
paths:
- backend/**
- .github/workflows/backend.yml
branches: [ "**" ]
tags: [ 'org-*.*.*' ]
env:
BASE_IMAGE_NAME: ghcr.io/hopps-app/hopps
# prefix which needs to be in front of version tags
VERSION_TAG_PREFIX: 'org-'
# FIXME: This builds and pushes every backend service anytime a change is made
# inside 'backend/**'
jobs:
build-code-and-container:
strategy:
fail-fast: false
matrix:
service:
- label: fin
directory: app.hopps.fin
- label: org
directory: app.hopps.org
- label: az-document-ai
directory: app.hopps.az-document-ai
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
# only build relevant service
- name: mvn package
run: mvn -B clean package --file backend/${{ matrix.service.directory }}/pom.xml
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ format('{0}/{1}', env.BASE_IMAGE_NAME, matrix.service.label) }}
tags: |
# increasing run number tag on main
type=raw,value=${{ github.run_number }},enable={{is_default_branch}}
# for version tags (only works for tags)
type=match,pattern=${{ env.VERSION_TAG_PREFIX }}\d.\d.\d
# for containers on feature branches
type=ref,event=branch,enable=${{ github.ref_name != github.event.repository.default_branch }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: backend/${{ matrix.service.directory }}
file: backend/${{ matrix.service.directory }}/src/main/docker/Dockerfile.jvm
# don't push dependabot branches
push: ${{ !startsWith(github.ref, 'refs/heads/dependabot') }}
tags: ${{ steps.meta.outputs.tags }} # tags from the docker/metadata-action