-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (67 loc) · 2.24 KB
/
cd-pr-generic.yaml
File metadata and controls
70 lines (67 loc) · 2.24 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
on:
workflow_call:
inputs:
gh_user:
type: string
required: true
gh_repo:
type: string
required: true
gh_base_branch:
type: string
required: true
image_name:
type: string
required: true
image_tag:
type: string
required: true
env_name:
type: string
required: true
app_path:
type: string
required: true
auto_merge:
type: boolean
required: true
assignees:
type: string
required: false
default: ""
secrets:
ACCESS_TOKEN:
required: true
jobs:
create_pr:
name: Create PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update kustomization.yaml
uses: mikefarah/yq@3.3.0
with:
cmd: yq w -i ./${{ inputs.app_path }}/overlays/${{ inputs.env_name }}/kustomization.yaml "images.(name==${{ inputs.image_name }}).newTag" ${{ inputs.image_tag }}
- name: Build
uses: docker://automationcloud/kustomize:latest
with:
kustomize_build_dir: "./${{ inputs.app_path }}/overlays/${{ inputs.env_name }}"
kustomize_output_file: "./${{ inputs.app_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: ${{ inputs.gh_user }}
repository: ${{ inputs.gh_repo }}
message: Update image
files: ${{ inputs.app_path }}/overlays/${{ inputs.env_name }}/kustomization.yaml,${{ inputs.app_path }}/manifests/${{ inputs.env_name }}/install.yaml
title: ${{ inputs.app_path }} ⇒ ${{ inputs.image_tag }} (${{ inputs.env_name }})
body: Automated PR for ${{ inputs.image_name }}:${{ inputs.image_tag }} (${{ inputs.env_name }})
head: ${{ inputs.image_name }}-${{ github.run_id }}-${{ inputs.env_name }}
base: ${{ inputs.gh_base_branch }}
draft: false
maintainer_can_modify: true
merge: ${{ inputs.auto_merge }}
assignees: ${{ inputs.assignees }}