Release service #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release service | |
on: | |
workflow_dispatch: | |
inputs: | |
service_name: | |
description: 'Service name' | |
required: true | |
type: choice | |
options: | |
- a | |
- b | |
automatic_deploy_to_dev: | |
description: "Automatically deploy this release to DEV environment" | |
type: boolean | |
workflow_call: | |
inputs: | |
service_name: | |
required: true | |
type: string | |
automatic_deploy_to_dev: | |
type: boolean | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: services/${{ inputs.service_name }}/ | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Build docker image | |
run: make build | |
- name: Tag the docker image | |
id: tag_image | |
run: make release | |
- uses: thejeff77/[email protected] | |
with: | |
tag: ${{ steps.tag_image.outputs.next_tag }} | |
message: '"${{ steps.tag_image.outputs.next_tag }}: PR #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}"' | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.tag_image.outputs.next_tag }} | |
generate_release_notes: true | |
prerelease: ${{ github.event_name == 'workflow_dispatch' }} | |
- 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 |