Refresh GeoDB #1427
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: Refresh GeoDB | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 */4 * * *" | |
permissions: | |
id-token: write | |
jobs: | |
refresh-geodb: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure aws credentials using OIDC | |
uses: aws-actions/configure-aws-credentials@master | |
with: | |
role-to-assume: arn:aws:iam::283582579564:role/geodb_refresh_role | |
role-session-name: SREBotGitHubActions | |
aws-region: "ca-central-1" | |
- name: Download GeoDB and update to bucket | |
run: | | |
wget -O GeoLite2-City.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${{ secrets.MAXMIND_LICENSE }}&suffix=tar.gz" | |
aws s3 cp GeoLite2-City.tar.gz s3://${{ secrets.GEO_DB_BUCKET }}/GeoLite2-City.tar.gz | |
- name: Notify Slack channel if this job failed | |
if: ${{ failure() }} | |
run: | | |
json='{"text":"GeoDB Refresh failed in <https://github.com/${{ github.repository }}>!"}' | |
curl -X POST -H 'Content-type: application/json' --data "$json" ${{ secrets.SLACK_NOTIFY_WEBHOOK }} |