Skip to content

Commit

Permalink
Merge pull request #4 from energomonitor/automatic_deploy_to_dev
Browse files Browse the repository at this point in the history
this feature allow automatic deploy to dev if PR is merged
  • Loading branch information
JaSei authored Oct 31, 2023
2 parents f472182 + 33c879c commit 6dad7af
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/_service_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
service_name:
required: true
type: string
automatic_deploy_to_dev:
type: boolean

jobs:
release:
Expand Down Expand Up @@ -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
5 changes: 3 additions & 2 deletions .github/workflows/a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6dad7af

Please sign in to comment.