From d20cb95fd7098fba63cce46d2f359b2ac0ffd905 Mon Sep 17 00:00:00 2001 From: Hans <11695964+hupling@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:19:41 +0200 Subject: [PATCH] Update backend-maven-node-build.yml --- .../workflows/backend-maven-node-build.yml | 48 +++++++------------ 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/.github/workflows/backend-maven-node-build.yml b/.github/workflows/backend-maven-node-build.yml index 01de903..513e887 100644 --- a/.github/workflows/backend-maven-node-build.yml +++ b/.github/workflows/backend-maven-node-build.yml @@ -1,46 +1,34 @@ name: Compliance check and build test - env: - - APP_PATH: "/sps-backend" # example "/backend" for monorepos or "" for multi repos + app-path: "/sps-backend" # example "/backend" for monorepos or "" for multi repos on: # defining on which triggers this action should run push: branches: # define on push of which branches should this action be run paths: - - "sps-backend/**" # define the concrete paths on which a change triggers this action, e.g. backend/** - - ".github/workflows/**" # define the concrete paths on which a change triggers this action, e.g. backend/** + - "sps-backend/**" # define the concrete paths on which a change triggers this action, e.g. backend/** + - ".github/workflows/**" # define the concrete paths on which a change triggers this action, e.g. backend/** pull_request: # trigger this action also on Pull Requests - types: [ opened, reopened ] - -jobs: + types: [opened, reopened] +jobs: build-maven: - runs-on: ubuntu-latest - steps: - - - uses: it-at-m/.github/.github/actions/action-maven-node-build@reuseable-workflow - with: - app-path: ".${{ env.APP_PATH }}" - - #build-image: - # needs: build-maven - # uses: it-at-m/.github/.github/workflows/reuseable-template-build-image.yml@reuseable-workflow - # with: - -# app-path: "/sps-backend" -# secrets: -# registry-password: ${{ secrets.GITHUB_TOKEN }} + runs-on: ubuntu-latest + steps: + - uses: it-at-m/.github/.github/actions/action-maven-node-build@reuseable-workflow + with: + app-path: "${{ env.app-path }}" build-image: runs-on: ubuntu-latest needs: build-maven - steps: - - uses: it-at-m/.github/.github/actions/action-build-image@reuseable-workflow - with: - app-path: "${{ env.APP_PATH }}" - registry-password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io # ${{ env.REGISTRY }} - registry-username: ${{ github.actor }} + if: github.ref == 'refs/heads/main' + steps: + - uses: it-at-m/.github/.github/actions/action-build-image@reuseable-workflow + with: + app-path: "${{ env.app-path }}" + registry-password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + registry-username: ${{ github.actor }}