Bitcoin Optech #93
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: Bitcoin Optech | |
on: | |
schedule: | |
- cron: '0 13 * * 3' # every Wednesday at 1pm UTC | |
workflow_dispatch: | |
repository_dispatch: | |
jobs: | |
fetch: | |
if: (github.event.action == 'scrape' && github.event.client_payload.repository == 'aureleoules/test') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check password | |
if: github.event_name == 'scrape' | |
run: if [ "${{ github.event.client_payload.secret }}" != "${{ secrets.COMMON_SECRET }}" ]; then echo "Wrong password"; exit 1; fi | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: | | |
cd bitcoinops && yarn | |
cd ../common && yarn | |
- name: Fetch data | |
run: | | |
mkdir /tmp/data | |
cd bitcoinops && node main.js | |
env: | |
ES_ENGINE: ${{ secrets.ES_ENGINE }} | |
ES_URL: ${{ secrets.ES_URL }} | |
ES_TOKEN: ${{ secrets.ES_TOKEN }} | |
DATA_DIR: /tmp/data | |
CLOUD_ID: ${{ secrets.CLOUD_ID }} | |
USER_PASSWORD: ${{ secrets.USER_PASSWORD }} | |
USERNAME: ${{ secrets.USERNAME }} | |
INDEX: ${{ secrets.INDEX }} |