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

Update Weaviate Server Image #38

Closed
wants to merge 15 commits into from
47 changes: 34 additions & 13 deletions .github/workflows/update-weaviate-server.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
name: Update Weaviate Version
name: Update weaviate server image

on:
on:
push:
branches:
- weaviate-server
pull_request:
branches:
- weaviate-server
workflow_dispatch:
schedule:
- cron: '0 0 * * 1' # Every Monday at 00:00 UTC
env:
SOURCE_BRANCH_NAME: update-weaviate-image

jobs:
update-version:
Expand All @@ -17,24 +25,37 @@ jobs:
sudo apt-get update
sudo apt-get install -y jq

- name: Update Weaviate Version
run: make update-weaviate-version
- name: Update Image
run: make update-weaviate-image

- name: Commit and push if changed
run: |
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
git add tests/docker-compose.yml
git diff-index --quiet HEAD || (git commit -m "Update Weaviate version in tests/docker-compose.yml" && git push)
git diff-index --quiet HEAD || (git checkout -b ${{ env.SOURCE_BRANCH_NAME }} && git commit -m "Update Weaviate version in tests/docker-compose.yml" && git push --set-upstream origin ${{ env.SOURCE_BRANCH_NAME }})

- name: Create Pull Request
uses: actions/github-script@v3
uses: actions/github-script@v7
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const title = "Update Weaviate Version";
const body = "This PR updates the Weaviate version in tests/docker-compose.yml";
const branch = "main"; # Change to your target branch
const head = process.env.GITHUB_REF.split('/').pop();
const base = branch;
github.pulls.create({owner, repo, title, body, head, base});
const { repo, owner } = context.repo;
const result = await github.rest.pulls.create({
title: 'Update Weaviate Server Image',
owner,
repo,
head: '${{ env.SOURCE_BRANCH_NAME }}',
base: 'main',
body: [
'This PR updates the Weaviate version in tests/docker-compose.yml',
'This PR is auto-generated by',
'[actions/github-script](https://github.com/actions/github-script).'
].join('\n')
});
github.rest.issues.addLabels({
owner,
repo,
issue_number: result.data.number,
labels: ['quality-improvement', 'automated pr']
});
2 changes: 1 addition & 1 deletion tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- '8080'
- --scheme
- http
image: semitechnologies/weaviate:1.23.3
image: semitechnologies/weaviate:1.23.6
ports:
- "8080"
- "50051"
Expand Down