From b80006649eebce4dd6bed0fe3f200ad850b78158 Mon Sep 17 00:00:00 2001 From: Faye Date: Wed, 6 Dec 2023 17:19:32 +0100 Subject: [PATCH] Try using reuseable actions workflow for Github Actions --- .github/workflows/main.yml | 39 ++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e9b1de..5b8fd49 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,17 +7,36 @@ on: #schedule: # - cron: '0 0 1,5,10,15,20,25 * *' -jobs: +# jobs: + +# build-publish-trigger: +# runs-on: ubuntu-latest +# env: +# DOCKER_PASS: ${{ secrets.DOCKER_PASS }} +# DOCKER_USER: ${{ secrets.DOCKER_USER }} +# steps: +# - name: Checkout +# uses: actions/checkout@v4 - build-publish-trigger: +# - name: Build image, test it, push it dockerhub, notify dependents +# run: ./pipe_build_up_test.sh + +jobs: + pre-build: runs-on: ubuntu-latest - env: - DOCKER_PASS: ${{ secrets.DOCKER_PASS }} - DOCKER_USER: ${{ secrets.DOCKER_USER }} steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - - name: Build image, test it, push it dockerhub, notify dependents - run: ./pipe_build_up_test.sh - \ No newline at end of file + build-publish: + needs: [pre-build] + permissions: + id-token: write + contents: write + uses: cyber-dojo/reusable-actions-workflows/.github/workflows/kosli_build_test_push_dockerhub.yml@main + secrets: + DOCKER_PASS: ${{ secrets.DOCKER_PASS }} + DOCKER_USER: ${{ secrets.DOCKER_USER }} + KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }} + with: + BUILD_COMMAND: pipe_build_up_test.sh + KOSLI_FLOW: java \ No newline at end of file