-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (42 loc) · 1.3 KB
/
_deploy.yml
File metadata and controls
47 lines (42 loc) · 1.3 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
name: deploy
on:
workflow_call:
inputs:
VALUE_FILE:
required: true
type: string
REGISTRY:
required: true
type: string
secrets:
HETZNER_ACTIONS_RUNNER_TOKEN:
required: true
workflow_dispatch:
jobs:
update_image_version:
runs-on: [self-hosted, "hetzner"]
steps:
- name: Checkout Target Repository
uses: actions/checkout@v3
with:
repository: Bot-detector/bot-detector-k8s
- name: Set vars
id: vars
run: |
echo "GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
- name: Update Image Version
uses: fjogeleit/yaml-update-action@main
with:
repository: Bot-detector/bot-detector-k8s
valueFile: ${{ inputs.VALUE_FILE }}
token: "${{ secrets.HETZNER_ACTIONS_RUNNER_TOKEN }}"
commitChange: true
title: "${{ inputs.VALUE_FILE }}_${{ steps.vars.outputs.GIT_HASH }}"
branch: "${{ inputs.VALUE_FILE }}_${{ steps.vars.outputs.GIT_HASH }}"
targetBranch: develop
masterBranchName: develop
createPR: true
changes: |
{
"spec.template.spec.containers[0].image": "${{ inputs.REGISTRY }}:${{ steps.vars.outputs.GIT_HASH }}"
}