-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (85 loc) · 3.51 KB
/
helm-deploy-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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Deploy Release
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
release-tag:
description: 'Tag to deploy (e.g. 0.1.1)'
type: string
required: true
jobs:
deploy-published-release:
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.release.tag_name }}
- name: Get Last Tag Commit Author
id: tag-commit-author
run: |
echo ::set-output name=name::$(git log -1 --pretty=format:'%an')
echo ::set-output name=email::$(git log -1 --pretty=format:'%ae')
- name: Get Tag Commit Info
id: tag-commit-info
run: |
echo ::set-output name=message::$(git log -n 1 --pretty=format:'%s')
echo ::set-output name=commit::$(git log -n 1 --format=format:%H)
- name: Trigger Release Deploy Workflow
uses: peter-evans/repository-dispatch@v3
with:
event-type: release-created
repository: rowi1de/argocd
token: ${{ secrets.REPO_ACCESS_TOKEN }}
client-payload: |
{
"repository": "${{ github.repository }}",
"release_tag": "${{ github.event.release.tag_name }}",
"sha": "${{ steps.tag-commit-info.outputs.commit}}",
"author": "${{ steps.tag-commit-author.outputs.name }} (${{ steps.tag-commit-author.outputs.email}})",
"actor": "${{ github.actor }}",
"manifest": "./services/graphql-reactive.yaml",
"message" : "Automated trigger ${{ inputs.release-tag }} by ${{ github.actor }} : ${{ steps.tag-commit-info.outputs.message}}"
}
deploy-manual-release:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.release-tag }}
- name: Get Tag Commit Author
id: tag-commit-author
run: |
echo ::set-output name=name::$(git log -1 --pretty=format:'%an')
echo ::set-output name=email::$(git log -1 --pretty=format:'%ae')
- name: Get Tag Commit Info
id: tag-commit-info
run: |
echo ::set-output name=message::$(git log -n 1 --pretty=format:'%s')
echo ::set-output name=commit::$(git log -n 1 --format=format:%H)
- name: Trigger Manual Deploy Workflow
uses: peter-evans/repository-dispatch@v3
with:
event-type: release-created
repository: rowi1de/argocd
token: ${{ secrets.REPO_ACCESS_TOKEN }}
client-payload: |
{
"repository": "${{ github.repository }}",
"release_tag": "${{ inputs.release-tag }}",
"sha": "${{ steps.tag-commit-info.outputs.commit}}",
"actor": "${{ github.actor }}",
"author": "${{ steps.tag-commit-author.outputs.name }} (${{ steps.tag-commit-author.outputs.email}})",
"manifest": "./services/graphql-reactive.yaml",
"message" : "Manual trigger ${{ inputs.release-tag }} by ${{ github.actor }} : ${{ steps.tag-commit-info.outputs.message}}"
}