-
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.
Signed-off-by: vsoch <[email protected]>
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Update USRSE Map | ||
|
||
on: | ||
pull_request: [] | ||
schedule: | ||
# Run once a week on Sunday | ||
- cron: 0 0 * * 0 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v1 | ||
|
||
- name: Install dependencies and run script | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y python3 python3-pip wget | ||
sudo pip3 install -r requirements.txt | ||
# Ensure using a particular version | ||
wget -O scripts/_update_map.py https://raw.githubusercontent.com/USRSE/usrse-map/f56677018ebc3f4f65eca185e8ecf9d5e0968b8c/scripts/update_map.py | ||
chmod +x scripts/_update_map.py | ||
python3 scripts/_update_map.py | ||
- name: Test Newly Generated Data | ||
run: pytest -v -x tests/test_*.py | ||
|
||
- name: Checkout New Branch | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH_AGAINST: "master" | ||
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 checkout -b update/member-map-$(date '+%Y-%m-%d') | ||
git branch | ||
git config --global user.name "github-actions" | ||
git config --global user.email "[email protected]" | ||
git add _data/locations.csv | ||
git commit -m "Automated deployment to update Member Map $(date '+%Y-%m-%d')" --allow-empty | ||
git push origin update/member-map-$(date '+%Y-%m-%d') | ||
export BRANCH_FROM="update/member-map-$(date '+%Y-%m-%d')" | ||
wget https://raw.githubusercontent.com/USRSE/usrse-map/f56677018ebc3f4f65eca185e8ecf9d5e0968b8c/scripts/pull-request.sh | ||
chmod +x ./pull-request.sh | ||
/bin/bash -e ./pull-request.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#uszipcode==0.2.4 | ||
geopy==1.21.0 | ||
requests | ||
pytest |
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