forked from Mirror-Protocol/terra-web-dapp
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.34 KB
/
main.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
name: deploy
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy_pinata:
runs-on: ubuntu-latest
name: Deploy to Pinata
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org
- name: Install node packages
run: npm ci
- name: Build the app
run: npm run build
- name: Pin to IPFS on Pinata
id: deploy
uses: anantaramdas/[email protected]
with:
pin-name: 'terra-web-dapp'
path: './build'
verbose: true
remove-old: false
pinata-api-key: ${{ secrets.PINATA_API_KEY }}
pinata-secret-api-key: ${{ secrets.PINATA_SECRET_API_KEY }}
# Use the output from the `deploy` step
- name: Get the output hash
run: echo "The hash was ${{ steps.deploy.outputs.hash }}"
- name: Update CloudFlare DNS with new IPFS hash
env:
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
RECORD_DOMAIN: ''
RECORD_NAME: '_dnslink'
uses: textileio/cloudflare-update-dnslink@v2
with:
cid: ${{ steps.deploy.outputs.hash }}