Skip to content
Merged
Changes from all 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
29 changes: 19 additions & 10 deletions .github/workflows/sync-lightspeed-configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@ on:
- cron: '0 4 * * *'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
sync-lightspeed:
name: Sync Lightspeed Configs
name: Sync Lightspeed Configs (${{ matrix.branch }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
branch:
- main
- release-1.10

concurrency:
group: ${{ github.workflow }}-${{ matrix.branch }}
cancel-in-progress: true

permissions:
contents: write
pull-requests: write
Expand All @@ -22,6 +29,7 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: ${{ matrix.branch }}
fetch-depth: 0

- name: Set up Helm
Expand Down Expand Up @@ -53,7 +61,7 @@ jobs:
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Sync Lightspeed config files
run: ./hack/sync-lightspeed-configs.sh
run: ./hack/sync-lightspeed-configs.sh --ref ${{ matrix.branch }}

- name: Check for changes
id: changes
Expand Down Expand Up @@ -97,11 +105,12 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_VERSION: ${{ steps.semver.outputs.new_version }}
TARGET_BRANCH: ${{ matrix.branch }}
run: |
TITLE="chore(lightspeed): sync config files and bump chart to ${NEW_VERSION}"
BRANCH="chore/sync-lightspeed-configs"
BRANCH="chore/sync-lightspeed-configs-${TARGET_BRANCH}"

EXISTING_PR=$(gh pr list --head "${BRANCH}" --state open --json number --jq '.[0].number // empty')
EXISTING_PR=$(gh pr list --head "${BRANCH}" --base "${TARGET_BRANCH}" --state open --json number --jq '.[0].number // empty')

git checkout -b "${BRANCH}"

Expand All @@ -119,7 +128,7 @@ jobs:
git push origin "${BRANCH}"

BODY=$(cat <<EOF
Automated nightly sync of Lightspeed config files from [redhat-ai-dev/lightspeed-configs](https://github.com/redhat-ai-dev/lightspeed-configs).
Automated nightly sync of Lightspeed config files from [redhat-ai-dev/lightspeed-configs @ ${TARGET_BRANCH}](https://github.com/redhat-ai-dev/lightspeed-configs/tree/${TARGET_BRANCH}).

Bumped chart version to **${NEW_VERSION}**.

Expand All @@ -137,5 +146,5 @@ jobs:
gh pr create \
--title "${TITLE}" \
--body "${BODY}" \
--base "${{ github.ref_name }}"
--base "${TARGET_BRANCH}"
fi
Loading