Skip to content

Main Updater

Main Updater #23

Workflow file for this run

name: Main Updater
on:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'
jobs:
litecoin_updater:
runs-on: ubuntu-latest
steps:
- name: Trigger Litecoin Updater
uses: actions/github-script@v6
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'litecoin_updater.yml',
ref: context.ref
});
- name: Save Update Time
run: echo "LITECOIN=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
dogecoin_updater:
runs-on: ubuntu-latest
needs: litecoin_updater
steps:
- name: Trigger Dogecoin Updater
uses: actions/github-script@v6
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'dogecoin_updater.yml',
ref: context.ref
});
- name: Save Update Time
run: echo "DOGECOIN=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
bitcoincash_updater:
runs-on: ubuntu-latest
needs: dogecoin_updater
steps:
- name: Trigger Bitcoin Cash Updater
uses: actions/github-script@v6
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'bitcoincash_updater.yml',
ref: context.ref
});
- name: Save Update Time
run: echo "BITCOINCASH=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
bitcoin_updater:
runs-on: ubuntu-latest
needs: bitcoincash_updater
steps:
- name: Trigger Bitcoin Updater
uses: actions/github-script@v6
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'bitcoin_updater.yml',
ref: context.ref
});
- name: Save Update Time
run: echo "BITCOIN=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
update_readme:
runs-on: ubuntu-latest
needs: bitcoin_updater
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Replace Variables in README
run: |
export UPDATE_TIME_LITECOIN=${LITECOIN}
export UPDATE_TIME_DOGECOIN=${DOGECOIN}
export UPDATE_TIME_BITCOINCASH=${BITCOINCASH}
export UPDATE_TIME=${BITCOIN}
envsubst < .github/README.template.md > README.md
- name: Commit and Push Changes
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add README.md
git commit -m "Updated README with latest coin update times"
git push origin main