-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
2 changed files
with
1,650 additions
and
29 deletions.
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 |
---|---|---|
@@ -1,41 +1,39 @@ | ||
on: | ||
schedule: | ||
# Every day after globe_history has been uploaded | ||
- cron: '21 5 * * *' | ||
# Every day after globe_history has been uploaded | ||
- cron: '21 5 * * *' | ||
# But also on push | ||
push: | ||
branches: | ||
- main | ||
|
||
|
||
- main | ||
jobs: | ||
update-db: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Update database | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
set -ex | ||
# We are idempotent | ||
# We try not to exit with an error code | ||
# We push if the files have changed, otherwise we do not | ||
- uses: actions/checkout@v2 | ||
- name: Update database | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
set -ex | ||
# We are idempotent | ||
# We try not to exit with an error code | ||
# We push if the files have changed, otherwise we do not | ||
# Install dependencies | ||
sudo apt-get -y install python3-pip python3-dev | ||
pip3 install --no-cache-dir -r requirements.txt | ||
# Install dependencies | ||
sudo apt-get -y install python3-pip python3-dev | ||
pip3 install --no-cache-dir -r requirements.txt | ||
# Run the script that affects RELEASES.md and PREFERRED_RELEASES.txt | ||
python3 update-releases.py | ||
# Run the script that affects RELEASES.md and PREFERRED_RELEASES.txt | ||
python3 update-releases.py | ||
# Now we try adding them, if they have changed | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git add RELEASES.md PREFERRED_RELEASES.txt README.md | ||
# Have we actually changed anything? | ||
if ! git diff-index --quiet HEAD --; then | ||
# We have changed something, so we commit and push | ||
git commit -m "Update RELEASES.md and PREFERRED_RELEASES.txt" | ||
git push | ||
fi | ||
# Now we try adding them, if they have changed | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git add RELEASES.md PREFERRED_RELEASES.txt README.md ALL_RELEASES.txt | ||
# Have we actually changed anything? | ||
if ! git diff-index --quiet HEAD --; then | ||
# We have changed something, so we commit and push | ||
git commit -m "Update RELEASES.md and PREFERRED_RELEASES.txt" | ||
git push | ||
fi |
Large diffs are not rendered by default.
Oops, something went wrong.