-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (38 loc) · 1.55 KB
/
dolt-db-backup-thirstythirsty.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
name: ThirstyThirsty Dolt Backup
on:
schedule:
- cron: "0 0 * * *" # Run every day at midnight
workflow_dispatch: # Run manually
jobs:
build:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission.
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
contents: write
env: # Define the variable 'SPACE' here
SPACE: "thirstythirsty"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Dolt
run: |
sudo bash -c 'curl -L https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash'
- name: Clone ${{ env.SPACE }} repository # Use the variable here
run: dolt clone nance/${{ env.SPACE }} $HOME/${{ env.SPACE }}
- name: Change dir, run dolt dump and save output
run: cd $HOME/${{ env.SPACE }} && dolt dump
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install libraries
run: npm install axios form-data dotenv
- name: Upload output to IPFS
id: ipfsPin
run: |
echo "INFURA_IPFS_ID=${{ secrets.INFURA_IPFS_ID }}" >> .env
echo "INFURA_IPFS_SECRET=${{ secrets.INFURA_IPFS_SECRET }}" >> .env
echo "MY_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> .env
echo "IPFS_GATEWAY=${{ secrets.IPFS_GATEWAY }}" >> .env
node ipfsPin.js ${{ env.SPACE }} $HOME/${{ env.SPACE }}/doltdump.sql