-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: update-compose-dbs | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "12 6,18 * * *" | ||
jobs: | ||
update_compose_dbs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12.0" | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }} | ||
|
||
- name: Install dependencies and actiavte virtualenv | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install --no-interaction --no-root | ||
- name: Check update | ||
run: | | ||
./scripts/gh_update_dbs_with_pr.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
DB_COMPOSE_FILE="$SCRIPT_DIR/../docker/docker-compose.dbs.yml" | ||
|
||
cd $SCRIPT_DIR/../ | ||
make update_compose_db_file | ||
DIFF=$(git diff $DB_COMPOSE_FILE) | ||
if [ "$DIFF" = "" ] | ||
then | ||
echo "no changes detected" | ||
else | ||
echo "file changed" | ||
timestamp=$(date +%s) | ||
branch="update-docker-compose-dbs-$timestamp" | ||
msg="update docker-compose.dbs.yml file" | ||
git branch $branch | ||
git commit -am $msg | ||
git push -u origin $branch | ||
gh pr create -B main -H $branch --title $msg --body 'Created by Github action' | ||
fi |