Update hpc.social Map #740
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
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 |