-
Notifications
You must be signed in to change notification settings - Fork 10
50 lines (46 loc) · 1.97 KB
/
newApplicationVersion.yml
File metadata and controls
50 lines (46 loc) · 1.97 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
name: New Application Version
on:
workflow_dispatch:
inputs:
tag_name:
required: true
app_repo:
required: true
image:
required: true
jobs:
update-image-tag:
runs-on: ubuntu-latest
steps:
- name: Wrap Input
run: |
echo "APP_REPO=${{ github.event.inputs.app_repo }}" >> $GITHUB_ENV
echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
echo "IMAGE=${{ github.event.inputs.image }}" >> $GITHUB_ENV
echo "DEPLOY_FILE_PATH=applications/${{ github.event.inputs.app_repo }}/deployment.yaml" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: azure/setup-kubectl@v1
id: install
- name: patch deployment manifest
run: kubectl patch --filename=${{ env.DEPLOY_FILE_PATH }} --patch='{"spec":{"template":{"spec":{"containers":[{"name":"${{ env.APP_REPO }}","image":"${{ env.IMAGE }}"}]}}}}' --local=true -o yaml > tmp.yaml
- name: commit change
run: |
git config user.name ${{ github.actor }}
git config user.email '${{ github.actor }}@users.noreply.github.com'
rm -f ${{ env.DEPLOY_FILE_PATH }}
mv tmp.yaml ${{ env.DEPLOY_FILE_PATH }}
git add ${{ env.DEPLOY_FILE_PATH }}
git diff-index --quiet HEAD || git commit -m "Set ${{ env.APP_REPO }} to version ${{ env.TAG_NAME }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
commit-message: Update report
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: new_release_${{ env.APP_REPO }}-${{ env.TAG_NAME }}
title: 'Set ${{ env.APP_REPO }} to version ${{ env.TAG_NAME }}'
body: |
This PR was automatically created.
Please review and merge to deploy.