Skip to content

Commit

Permalink
adds pinata and dnslink deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
samepant committed Apr 11, 2022
1 parent 8e4d30c commit 8bb2079
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 44 deletions.
14 changes: 0 additions & 14 deletions .fleek.dev.json

This file was deleted.

14 changes: 0 additions & 14 deletions .fleek.prod.json

This file was deleted.

35 changes: 27 additions & 8 deletions .github/workflows/dev-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,31 @@ jobs:
- run: npm install -g yarn
- run: yarn install --frozen-lockfile
- run: yarn build
- name: Setup fleek config file
run: cp ./.fleek.dev.json ./.fleek.json
- name: Deploy site
id: deploy
uses: fleekhq/action-deploy@v1

- name: Pin to IPFS
id: upload
uses: anantaramdas/ipfs-pinata-deploy-action@39bbda1ce1fe24c69c6f57861b8038278d53688d
with:
pin-name: Zodiac Safe App - Latest — ${ GITHUB_SHA }
path: './build'
pinata-api-key: ${{ secrets.PINATA_API_KEY }}
pinata-secret-api-key: ${{ secrets.PINATA_API_SECRET_KEY }}

- name: Convert CIDv0 to CIDv1
id: convert_cidv0
uses: uniswap/[email protected]
with:
apiKey: ${{ secrets.FLEEK_API_KEY }}
- name: Get the output url
run: echo "Deploy url is ${{ steps.deploy.outputs.deployUrl }}"
cidv0: ${{ steps.upload.outputs.hash }}

- name: Update DNS with new IPFS hash
env:
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
RECORD_DOMAIN: 'gnosisguild.org'
RECORD_NAME: '_dnslink.zodiac.dev'
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
uses: textileio/cloudflare-update-dnslink@0fe7b7a1ffc865db3a4da9773f0f987447ad5848
with:
cid: ${{ steps.upload.outputs.hash }}

- name: Get IPFS url
run: echo "IPFS gateways — https://${{ steps.convert_cidv0.outputs.cidv1 }}.ipfs.dweb.link/ or https://${{ steps.convert_cidv0.outputs.cidv1 }}.ipfs.cf-ipfs.com/"
49 changes: 41 additions & 8 deletions .github/workflows/prod-release-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,45 @@ jobs:
- run: npm install -g yarn
- run: yarn install --frozen-lockfile
- run: yarn build
- name: Setup fleek config file
run: cp ./.fleek.prod.json ./.fleek.json
- name: Deploy site
id: deploy
uses: fleekhq/action-deploy@v1

- name: Pin to IPFS
id: upload
uses: anantaramdas/ipfs-pinata-deploy-action@39bbda1ce1fe24c69c6f57861b8038278d53688d
with:
pin-name: Zodiac Safe App - Prod — ${ GITHUB_SHA }
path: './build'
pinata-api-key: ${{ secrets.PINATA_API_KEY }}
pinata-secret-api-key: ${{ secrets.PINATA_API_SECRET_KEY }}

- name: Convert CIDv0 to CIDv1
id: convert_cidv0
uses: uniswap/[email protected]
with:
cidv0: ${{ steps.upload.outputs.hash }}

- name: Update DNS with new IPFS hash
env:
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
RECORD_DOMAIN: 'gnosisguild.org'
RECORD_NAME: '_dnslink.zodiac'
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
uses: textileio/cloudflare-update-dnslink@0fe7b7a1ffc865db3a4da9773f0f987447ad5848
with:
cid: ${{ steps.upload.outputs.hash }}

- name: update release
id: update_release
uses: tubone24/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
apiKey: ${{ secrets.FLEEK_API_KEY }}
- name: Get the output url
run: echo "Deploy url is ${{ steps.deploy.outputs.deployUrl }}"
is_append_body: true
body: |
<br />
IPFS hash of the deployment:
- CIDv0: `${{ steps.upload.outputs.hash }}`
- CIDv1: `${{ steps.convert_cidv0.outputs.cidv1 }}`
IPFS gateways:
- https://${{ steps.convert_cidv0.outputs.cidv1 }}.ipfs.dweb.link/
- https://${{ steps.convert_cidv0.outputs.cidv1 }}.ipfs.cf-ipfs.com/

0 comments on commit 8bb2079

Please sign in to comment.