Fetch and Commit Prices #7
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: Fetch and Commit Prices | |
on: | |
schedule: | |
# Runs at 00:00 UTC on the 13th of every month | |
- cron: '0 0 13 * *' | |
workflow_dispatch: | |
jobs: | |
fetch_prices: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Go environment | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '^1.21' | |
- name: Download osmosisd binary | |
run: | | |
wget $(curl -s https://api.github.com/repos/osmosis-labs/osmosis/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep 'linux-amd64') -O osmosisd | |
chmod +x osmosisd | |
sudo mv osmosisd /usr/local/bin/ | |
- name: Fetch Prices | |
env: | |
OSMOSIS_RPC: ${{ vars.OSMOSIS_RPC }} | |
run: | | |
go run main.go fetch-prices | |
- name: Commit and Push Prices File | |
run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email '[email protected]' | |
git add prices/ | |
git commit -m "Automated prices update" | |
git push | |
- name: Trigger calculate-grant workflow | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
event-type: calculate-grant-trigger |