Skip to content

Load from blockchain #25244

Load from blockchain

Load from blockchain #25244

# This is a basic workflow to help you get started with Actions
name: Load from blockchain
# Controls when the workflow will run
on:
# Triggers the workflow every hour on the 21st minute
schedule:
- cron: "21 * * * *"
# 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:
check_for_updates:
name: Check for updates on-chain since last committed to repository
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Check-out tenthousandsu.com website repository
uses: actions/checkout@v6
- name: Check-out update-script repository
uses: actions/checkout@v6
with:
repository: "su-squares/update-script"
path: "update-script"
- name: Wire up update-script
run: |
mv build update-script/build
mv erc721 update-script/build/metadata
echo "PROVIDER_URL=${{ secrets.PROVIDER_URL }}" > update-script/.env
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: update-script/.nvmrc
cache: "yarn"
check-latest: true
cache-dependency-path: "update-script/yarn.lock"
- name: Install dependencies
run: |
cd update-script
yarn install --immutable
- name: Run have-there-been-updates
timeout-minutes: 5
run: |
cd update-script
yarn run have-there-been-updates || echo "LOAD=yes" >> $GITHUB_ENV
- name: Run load-blockchain
if: env.LOAD == 'yes'
timeout-minutes: 5
run: |
cd update-script
yarn run load-blockchain
- name: Export build from update-script
if: env.LOAD == 'yes'
run: |
mv update-script/build/metadata erc721
mv update-script/build build
- name: Commit back to this repository
if: env.LOAD == 'yes'
run: |
git add build erc721
git config user.name "update-script/load-blockchain.mjs"
git config user.email "<>"
git commit -m 'Load from blockchain'
git push