-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add example release logic (#1008)
Co-authored-by: Moritz Wiesinger <[email protected]>
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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@v3 | ||
|
||
- name: Checkout examples repo | ||
uses: actions/checkout@v3 | ||
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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters