-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.66 KB
/
_service_release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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