Skip to content

Update token-registry.json #42

Update token-registry.json

Update token-registry.json #42

# This is a basic workflow to help you get started with Actions
name: Update token-registry.json
# Controls when the workflow will run
on:
# Triggers the workflow on schedule every night at midnight.
schedule:
- cron: '0 0 * * *' # Run every day at midnight
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
update-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: "eu-west-2"
- name: List files in S3 bucket
run: |
files=$(aws s3 ls s3://rorcual-api/denoms/tokens_*.json | awk '{print $4}')
latest_file=$(echo "$files" | sort -r | head -n 1)
aws s3 cp s3://rorcual-api/denoms/"$latest_file" ./tokens.json
- name: Replace registry.json with tokens.json
run: mv tokens.json token-registry.json
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add token-registry.json
git commit -m "Update token-registry.json with latest tokens.json [skip ci]"
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: main