version: 2 jobs: build: docker: - image: circleci/node:10.15.1-browsers environment: NO_SANDBOX: true steps: - checkout - run: npm install - run: npm run build - persist_to_workspace: root: . paths: - public deploy: docker: - image: olizilla/ipfs-dns-deploy environment: DOMAIN: awesome.ipfs.io BUILD_DIR: public steps: - attach_workspace: at: /tmp/workspace - run: name: Deploy website to IPFS command: | pin_name="$DOMAIN build $CIRCLE_BUILD_NUMBER" hash=$(pin-to-cluster.sh "$pin_name" /tmp/workspace/$BUILD_DIR) echo "Website added to IPFS: https://ipfs.io/ipfs/$hash" if [ "$CIRCLE_BRANCH" == "master" ] ; then dnslink-dnsimple -d $DOMAIN -r _dnslink -l /ipfs/$hash fi workflows: version: 2 build-deploy: jobs: - build - deploy: context: ipfs-dns-deploy requires: - build