-
Notifications
You must be signed in to change notification settings - Fork 24
56 lines (52 loc) · 1.56 KB
/
deployment.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
name: Deployment
concurrency:
group: production
cancel-in-progress: true
on:
workflow_run:
workflows: ["Docker build"]
types:
- completed
branches:
- 'master'
jobs:
deployment:
runs-on: ubuntu-latest
environment: m39
steps:
-
name: Checkout
uses: actions/checkout@v2
- name: git tag
run: git fetch --tags; git fetch --prune --unshallow || true
- name: Extract tag name
id: dockerTag
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const tagExec = await exec.getExecOutput('git', ['describe', '--tags', '--abbrev=0']);
let tag = tagExec.stdout || tagExec.stderr;
tag = tag.trim().replace('v', '');
return tag;
-
name: Checkout
uses: actions/checkout@v2
with:
repository: ${{ secrets.REPO_NAME }}
path: infra
token: ${{ secrets.GHR_TOKEN }}
- name: Update Image Version in the related HelmChart values.yaml
uses: fjogeleit/yaml-update-action@v0.10.0
with:
valueFile: 'mort/values.yaml'
propertyPath: 'image.tag'
value: ${{ steps.dockerTag.outputs.result }}
repository: ${{ secrets.REPO_NAME }}
branch: master
# targetBranch: master
createPR: false
message: 'Update mort image to ${{ steps.dockerTag.outputs.result}}'
token: ${{ secrets.GHR_TOKEN }}
workDir: infra