Skip to content

Commit

Permalink
chore: add system upgrade workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Mar 18, 2024
1 parent 3bb9b9d commit 13f3f11
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
paths:
- 'charts/**'
- '.github/**'
workflow_dispatch:

jobs:
lint-chart:
Expand Down
30 changes: 27 additions & 3 deletions .github/workflows/upgrade-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,37 @@ jobs:
- name: Install dependencies
run: pip install -r requirements.txt

# - name: Bump chart versions
# run: python upgrade.py
- name: Bump chart versions
run: python upgrade.py

- name: Check if changes detected
id: diff
run: echo "changes=$(git diff --exit-code > /dev/null || echo $?)" >> $GITHUB_OUTPUT

- name: Debug
- name: Pre-commit
if: ${{ steps.diff.outputs.changes == '1' }}
run: bash pre-commit.sh

- name: Changes
if: ${{ steps.diff.outputs.changes == '1' }}
run: git diff

- name: Commit and push
if: ${{ steps.diff.outputs.changes == '1' }}
run: |
git commit -m "chore: automated service version bump"
git push -u origin master
- uses: benc-uk/workflow-dispatch@v1
id: dispatcher
with:
workflow: upgrade-system.yaml
ref: master

- name: Await Run ID ${{ steps.dispatcher.outputs.workflowId }}
uses: Codex-/[email protected]
with:
token: ${{ github.token }}
owner: restorecommerce
repo: charts
run_id: ${{ steps.dispatcher.outputs.workflowId }}
53 changes: 53 additions & 0 deletions .github/workflows/upgrade-system.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Upgrade System Chart

on:
repository_dispatch:
types: [upgrade-system]
workflow_dispatch:

jobs:
upgrade:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Add helm repos
run: .github/add-repos.sh

- name: Install dependencies
run: pip install -r requirements.txt

- name: Bump chart versions
run: python upgrade_system.py

- name: Check if changes detected
id: diff
run: echo "changes=$(git diff --exit-code > /dev/null || echo $?)" >> $GITHUB_OUTPUT

- name: Pre-commit
if: ${{ steps.diff.outputs.changes == '1' }}
run: bash pre-commit.sh

- name: Changes
if: ${{ steps.diff.outputs.changes == '1' }}
run: git diff

- name: Commit and push
if: ${{ steps.diff.outputs.changes == '1' }}
run: |
git commit -m "chore: automated system version bump"
git push -u origin master
- uses: benc-uk/workflow-dispatch@v1
with:
workflow: release.yaml
ref: master

0 comments on commit 13f3f11

Please sign in to comment.