Created
March 13, 2022 21:48
-
-
Save ries9112/a6bf3d540a4baf562c227bb61deddcb8 to your computer and use it in GitHub Desktop.
Script to automate upload of CV parcel content to arweave
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: Automated Backups Cryptovoxels | |
on: | |
schedule: | |
- cron: '0 10 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16.3.0' | |
- name: npm install | |
run: | | |
npm install -g arkb | |
- name: Run Backups | |
run: | | |
node -v ; | |
arkb -v ; | |
echo "Downloading map info..." ; | |
curl -s 'https://www.cryptovoxels.com/api/parcels.json' > CryptoVoxelsArchive/parcels.json ; | |
curl -s 'https://www.cryptovoxels.com/api/suburbs.json' > CryptoVoxelsArchive/suburbs.json ; | |
curl -s 'https://www.cryptovoxels.com/api/islands.json' > CryptoVoxelsArchive/islands.json ; | |
cat CryptoVoxelsArchive/parcels.json | jq '.parcels | .[] | .id' | while read id ; | |
do | |
echo "Downloading land parcel info $id..." | |
curl -s "https://www.cryptovoxels.com/grid/parcels/$id" > CryptoVoxelsArchive/parcels/$id.json | |
done | |
echo "Creating zip." ; | |
zip -r -q CryptoVoxels-latest-archive.zip CryptoVoxelsArchive ; | |
echo "Deploying archive to Arweave." ; | |
arkb deploy CryptoVoxels-latest-archive.zip --auto-confirm --wallet arweave-keyfile-f7QsdAM6sBC0UsUp1JoEXT93yMbCAPQIo1uBLhjDGSE.json --tag.Tag-Name=CryptoVoxelsArchive ; | |
- name: Commit and push files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "ries9112" | |
git add . | |
git commit -m "Automated CV backups from CI automated process" -a | |
git push https://ries9112:${{secrets.TOKEN}}@github.com/ries9112/CV-arweave-backups.git HEAD:main --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment