Skip to content

Setup Pipeline CRYPTO

Sergii Bomko edited this page Mar 12, 2020 · 1 revision

Requirements

  1. Before setting up a pipeline the CNS name should be configured, it should have a resolver. Take a look on prev page

  2. Basic pipeline should be configured with step which provides IPFS hash

Pipeline step

Open and add the step to main.yml

- uses: aquiladev/ddns-action@v0.1.1
  with:
    mnemonic: ${{ secrets.MNEMONIC }}
    rpc: ${{ secrets.RPC }}
    name: ddns-action.crypto
    contentHash: ${{ steps.upload.outputs.hash }}

Parameters

  • ${{ secrets.MNEMONIC }} is a secret. The mnemonic phrase is needed for wallet recovery of an account which owns CNS name. It can be a private key of the account as well

  • ${{ secrets.RPC }} is a secret. RPC is a URL of Ethereum Mainnet node

  • ddns-action.crypto - CNS name which you want to update

  • ${{ steps.upload.outputs.hash }} is content hash. It came from upload to IPFS step

Secrets

In order to manage sercerts in a repository you need to open Settings → Secrets

github-secrets

Pipeline

Eventually pipeline should look like

name: CI
on:
  push:
    branches:
    - master

jobs:
  build:
    runs-on: ubuntu-latest

steps:
  - uses: actions/checkout@v2
  
  - name: Setup Node
    uses: actions/setup-node@v1
    with:
      node-version: '10.x'

  - run: npm ci

  - run: npm run build
    
  - name: Upload to IPFS
    uses: aquiladev/ipfs-action@v0.1.2-alpha
    id: upload
    with:
      path: ./build
    
  - name: Update CNS
    uses: aquiladev/ddns-action@v0.1.1
    with:
      mnemonic: ${{ secrets.MNEMONIC }}
      rpc: ${{ secrets.RPC }}
      name: ddns-action.crypto
      contentHash: ${{ steps.upload.outputs.hash }}

Run pipeline

The pipeline will run immediately after commit (if you committed to master branch)

github-pipeline

You can open all pipeline runs and check outputs

github-pipeline-details

Clone this wiki locally