From 33c879c80c983cf1960caa3f1a957082aa7189df Mon Sep 17 00:00:00 2001 From: Jan Seidl Date: Mon, 30 Oct 2023 17:29:16 +0100 Subject: [PATCH] this feature allow automatic deploy to dev if PR is merged --- .github/workflows/_service_release.yaml | 10 ++++++++++ .github/workflows/a.yaml | 5 +++-- .github/workflows/release.yaml | 10 ++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_service_release.yaml b/.github/workflows/_service_release.yaml index 9d6f28a..b9132f7 100644 --- a/.github/workflows/_service_release.yaml +++ b/.github/workflows/_service_release.yaml @@ -6,6 +6,8 @@ on: service_name: required: true type: string + automatic_deploy_to_dev: + type: boolean jobs: release: @@ -38,3 +40,11 @@ jobs: with: tag_name: ${{ steps.tag_image.outputs.next_tag }} generate_release_notes: true + + - name: Automatic deploy to Dev + if: ${{ inputs.automatic_deploy_to_dev == 'true' }} + uses: ./.github/workflows/release.yaml + with: + checkout_ref: ${{ steps.tag_image.outputs.next_tag }} + service_name: ${{ inputs.service_name }} + environment: dev diff --git a/.github/workflows/a.yaml b/.github/workflows/a.yaml index 108a6ed..b3da8d0 100644 --- a/.github/workflows/a.yaml +++ b/.github/workflows/a.yaml @@ -16,13 +16,14 @@ on: - services/a jobs: - pull-request-job: + test-job: uses: ./.github/workflows/_service_test.yaml with: service_name: a - push-job: + release-job: if: github.event.pull_request.merged == true uses: ./.github/workflows/_service_release.yaml with: service_name: a + automatic_deploy_to_dev: true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b2be2f1..e00fb64 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,6 +25,16 @@ on: - dev - stage - prod + workflow_call: + inputs: + checkout_ref: + required: true + service_name: + required: true + type: string + environment: + required: true + type: string jobs: deploy: