-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcd-pr-multiple-images-kube.yaml
More file actions
80 lines (74 loc) · 2.94 KB
/
cd-pr-multiple-images-kube.yaml
File metadata and controls
80 lines (74 loc) · 2.94 KB
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
on:
workflow_call:
inputs:
image_name_one:
required: true
type: string
image_name_two:
required: true
type: string
image_name_three:
required: true
type: string
image_name_four:
required: true
type: string
image_tag:
required: true
type: string
path:
required: true
type: string
auto_merge:
required: true
type: boolean
env_name:
required: true
type: string
secrets:
ACCESS_TOKEN:
required: true
jobs:
create_pr:
name: Create PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update kustomization.yaml for image one
uses: mikefarah/yq@3.3.0
with:
cmd: yq w -i ./kube/${{ inputs.path }}/overlays/${{ inputs.env_name }}/kustomization.yaml "images.(name==${{ inputs.image_name_one }}).newTag" ${{ inputs.image_tag }}
- name: Update kustomization.yaml for image two
uses: mikefarah/yq@3.3.0
with:
cmd: yq w -i ./kube/${{ inputs.path }}/overlays/${{ inputs.env_name }}/kustomization.yaml "images.(name==${{ inputs.image_name_two }}).newTag" ${{ inputs.image_tag }}
- name: Update kustomization.yaml for image three
uses: mikefarah/yq@3.3.0
with:
cmd: yq w -i ./kube/${{ inputs.path }}/overlays/${{ inputs.env_name }}/kustomization.yaml "images.(name==${{ inputs.image_name_three }}).newTag" ${{ inputs.image_tag }}
- name: Update kustomization.yaml for image four
uses: mikefarah/yq@3.3.0
with:
cmd: yq w -i ./kube/${{ inputs.path }}/overlays/${{ inputs.env_name }}/kustomization.yaml "images.(name==${{ inputs.image_name_four }}).newTag" ${{ inputs.image_tag }}
- name: Build
uses: docker://automationcloud/kustomize:latest
with:
kustomize_build_dir: "./kube/${{ inputs.path }}/overlays/${{ inputs.env_name }}"
kustomize_output_file: "./kube/${{ inputs.path }}/manifests/${{ inputs.env_name }}/install.yaml"
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Create the PR
uses: docker://automationcloud/pull-request:latest
with:
token: ${{ secrets.ACCESS_TOKEN }}
owner: ubio
repository: k8s
message: Update image
files: kube/${{ inputs.path }}/overlays/${{ inputs.env_name }}/kustomization.yaml,kube/${{ inputs.path }}/manifests/${{ inputs.env_name }}/install.yaml
title: Update ${{ inputs.image_name_one }} to ${{ inputs.image_tag }} (${{ inputs.env_name }})
body: Automated PR for ${{ inputs.image_name_one }}:${{ inputs.image_tag }} (${{ inputs.env_name }})
head: ${{ inputs.image_name_one }}-${{ github.run_id }}-${{ inputs.env_name }}
base: master
draft: false
maintainer_can_modify: true
merge: ${{ inputs.auto_merge }}