-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (65 loc) · 2.41 KB
/
load-from-blockchain.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# 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@v3
- name: Check-out update-script repository
uses: actions/checkout@v3
with:
repository: 'su-squares/update-script'
path: 'update-script'
- name: Wire up update-script
env:
UPDATE_SCRIPT_CONFIG_JSON: ${{ secrets.UPDATE_SCRIPT_CONFIG_JSON }}
run: |
mv build update-script/build
mv erc721 update-script/build/metadata
echo $UPDATE_SCRIPT_CONFIG_JSON > update-script/config.json
- name: Set up Node 16
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
cache-dependency-path: 'update-script/yarn.lock'
- name: Install package dependencies with yarn
run: |
cd update-script
yarn install --immutable
- name: Run have-there-been-updates.mjs
timeout-minutes: 5
run: |
cd update-script
node have-there-been-updates.mjs || echo "LOAD=yes" >> $GITHUB_ENV
- name: Run load-blockchain.mjs
if: env.LOAD == 'yes'
timeout-minutes: 5
run: |
cd update-script
node load-blockchain.mjs
- 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 -u origin main:workflow-test
git push