forked from keptn/lifecycle-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (50 loc) · 1.62 KB
/
release-examples.yml
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
name: Release Examples
on:
workflow_call:
inputs:
tag_name:
description: "Tag for the release being created"
type: "string"
required: true
examples_dir:
description: "Root directory of the examples"
type: "string"
required: false
default: "./tmp/examples/"
dry_run:
description: "Flag for testing"
type: "boolean"
default: false
required: false
jobs:
release-examples:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout examples repo
uses: actions/checkout@v4
with:
repository: keptn-sandbox/lifecycle-toolkit-examples
path: ${{ inputs.examples_dir }}
token: ${{ secrets.KEPTN_BOT_TOKEN }}
- name: Get Latest Release Information
uses: octokit/[email protected]
id: latest_release
with:
route: GET /repos/:owner/:repository/releases/latest
repository: lifecycle-toolkit
owner: keptn
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Move old latest release examples folder
if: ${{ fromJson(steps.latest_release.outputs.data).tag_name == inputs.tag_name }}
run: cp -R ./examples/* "${{ inputs.examples_dir }}"
- name: Push content
if: inputs.dry_run != true
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
cwd: ${{ inputs.examples_dir }}
message: "feat: release examples ${{ inputs.tag_name }}"
tag: "${{ inputs.tag_name }}"