Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add example release logic #1008

Merged
merged 8 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/release-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release Documentation
thisthat marked this conversation as resolved.
Show resolved Hide resolved
aepfli marked this conversation as resolved.
Show resolved Hide resolved

on:
workflow_call:
inputs:
tag_name:
description: "Tag for the functions runner image"
aepfli marked this conversation as resolved.
Show resolved Hide resolved
type: "string"
required: true
examples_dir:
description: "Root directory of the website"
aepfli marked this conversation as resolved.
Show resolved Hide resolved
type: "string"
required: false
default: "./tmp/examples/"
dry_run:
description: "Flag for testing"
type: "boolean"
default: false
required: false

jobs:
release-docs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Checkout - page branch
aepfli marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/checkout@v3
with:
repository: keptn-sandbox/lifecycle-toolkit-examples
path: ${{ inputs.page_dir }}
aepfli marked this conversation as resolved.
Show resolved Hide resolved
token: ${{ secrets.KEPTN_BOT_TOKEN }}

- name: Get Latest Release Information
uses: octokit/[email protected]
aepfli marked this conversation as resolved.
Show resolved Hide resolved
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 documentation folder
aepfli marked this conversation as resolved.
Show resolved Hide resolved
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 }}
aepfli marked this conversation as resolved.
Show resolved Hide resolved
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
cwd: ${{ inputs.examples_dir }}
message: "feat: release examples ${{ inputs.tag_name }}"
aepfli marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,12 @@ jobs:
with:
tag_name: ${{ needs.release-please.outputs.tag_name }}
uses: ./.github/workflows/release-docs.yml

update-examples:
name: Update examples
needs:
- release-please
if: needs.release-please.outputs.releases_created == 'true'
with:
tag_name: ${{ needs.release-please.outputs.tag_name }}
uses: ./.github/workflows/release-examples.yml