-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.92 KB
/
cd-pr.yaml
File metadata and controls
57 lines (54 loc) · 1.92 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
on:
workflow_call:
inputs:
image_name:
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
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Update kustomization.yaml
uses: mikefarah/yq@3.3.0
with:
cmd: yq w -i ./configs/${{ inputs.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: "./configs/${{ inputs.path }}/overlays/${{ inputs.env_name }}"
kustomize_output_file: "./configs/${{ 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: configs/${{ inputs.path }}/overlays/${{ inputs.env_name }}/kustomization.yaml,configs/${{ inputs.path }}/manifests/${{ inputs.env_name }}/install.yaml
title: Update ${{ inputs.image_name }} to ${{ 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: master
draft: false
maintainer_can_modify: true
merge: ${{ inputs.auto_merge }}