-
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.29 KB
/
update-map.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Update hpc.social Map
on:
workflow_dispatch:
pull_request: []
schedule:
- cron: 0 2 * * *
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Update Map
run: |
sudo apt-get update && sudo apt-get install -y python3 python3-pip wget
sudo pip3 install -r scripts/requirements.txt
python3 scripts/update_map.py
- name: Test Newly Generated Data
run: pytest -v -x tests/test_*.py
- name: Checkout New Branch
if: (github.event_name != 'pull_request')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "GitHub Actor: ${GITHUB_ACTOR}"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git branch
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add _data/locations.csv
git add _data/group-locations.csv
if git diff-index --quiet HEAD --; then
printf "No changes\n"
else
printf "Changes\n"
git commit -m "Automated deployment to update map $(date '+%Y-%m-%d')" --allow-empty
git push origin main
fi