generated from cds-snc/project-template
-
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.
feat: hoist the refresh geodb outside of the Dockerfile (#464)
* feat: hoist the refresh geodb outside of the Dockerfile * feat: change to run refresh every 4 hours * chore: remove unused arg * fix: update script to fetch the geodb data
- Loading branch information
Showing
4 changed files
with
50 additions
and
6 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
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
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,29 @@ | ||
name: Refresh GeoDB | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 */4 * * *" | ||
|
||
jobs: | ||
s3-backup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_S3_BACKUP_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_S3_BACKUP_SECRET_ACCESS_KEY }} | ||
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 }} |
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