-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (78 loc) · 2.85 KB
/
pin-to-pinata.yaml
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
79
80
81
82
83
84
85
name: pin-to-pinata
on:
schedule:
- cron: "0 * * * *" # run every hour
workflow_dispatch:
jobs:
pin-to-pinata:
name: Pin images to Pinata
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ runner.os }}-${{ github.sha }}
restore-keys: |
turbo-${{ runner.os }}
- run: npm ci
- id: build
run: npm run build -- --cache-dir=".turbo"
- name: Set current date as env variable
run: echo "NOW=$(date +'%s')000" >> $GITHUB_ENV
- name: Set from date as env variable
run: echo "FROM_DATE=$(( $NOW - 24 * 60 * 60 * 1000 ))" >> $GITHUB_ENV
- name: Pin for each env
env:
PINATA_JWT: ${{ secrets.PINATA_JWT }}
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
INFURA_PROJECT_SECRET: ${{ secrets.INFURA_PROJECT_SECRET }}
run: |
echo "Pin for testing/amoy env..."
npm run pin-to-pinata -- \
-e testing \
-c testing-80002-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.INFURA_PROJECT_SECRET }}
echo "Pin for testing/sepolia env..."
npm run pin-to-pinata -- \
-e testing \
-c testing-11155111-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.INFURA_PROJECT_SECRET }}
echo "Pin for staging/amoy env..."
npm run pin-to-pinata -- \
-e staging \
-c staging-80002-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.INFURA_PROJECT_SECRET }}
echo "Pin for staging/sepolia env..."
npm run pin-to-pinata -- \
-e staging \
-c staging-11155111-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.INFURA_PROJECT_SECRET }}
echo "Pin for production/polygon env..."
npm run pin-to-pinata -- \
-e production \
-c production-137-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.INFURA_PROJECT_SECRET }}
echo "Pin for production/ethereum env..."
npm run pin-to-pinata -- \
-e production \
-c production-1-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.INFURA_PROJECT_SECRET }}