Skip to content

Commit

Permalink
fix: improving pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
aepfli committed Mar 23, 2023
1 parent a9f9426 commit a1846c2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/examples-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: YAML checks

on:
pull_request:
branches:
- 'main'
- '[0-9]+.[1-9][0-9]*.x'
- 'epic/*'
paths:
- 'examples'
jobs:
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 }}
dry_run: true
uses: ./.github/workflows/release-examples.yml
secrets: inherit


12 changes: 9 additions & 3 deletions .github/workflows/release-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
required: false

jobs:
release-docs:
release-examples:
runs-on: ubuntu-22.04
steps:
- name: Checkout
Expand All @@ -38,12 +38,12 @@ jobs:
with:
route: GET /repos/:owner/:repository/releases/latest
repository: lifecycle-toolkit
owner: ${{ env.GITHUB_REPOSITORY_OWNER }}
owner: aepfli
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 }}
if: ${{ fromJson(steps.latest_release.outputs.data).tag_name == inputs.tag_name || inputs.dry_run == true}}
run: cp -R ./examples/* "${{ inputs.examples_dir }}"

- name: Push content
Expand All @@ -54,3 +54,9 @@ jobs:
cwd: ${{ inputs.examples_dir }}
message: "feat: release examples ${{ inputs.tag_name }}"
tag: "${{ inputs.tag_name }}"

- name: Print content
if: inputs.dry_run == true
run: |
cd ${{ inputs.examples_dir }}
git status

0 comments on commit a1846c2

Please sign in to comment.