2019-04-30 08:33:54 -04:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2019-04-30 10:04:20 -04:00
|
|
|
awesome:
|
|
|
|
docker:
|
|
|
|
- image: circleci/ruby:2.4.2-jessie-node
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: gem install awesome_bot
|
|
|
|
- run: awesome_bot --allow-redirect --allow-dupe --allow-ssl -w ipfs.io README.md
|
|
|
|
|
2019-04-30 08:33:54 -04:00
|
|
|
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
|
2019-04-30 10:04:20 -04:00
|
|
|
check-links:
|
|
|
|
triggers:
|
|
|
|
- schedule:
|
|
|
|
cron: "0 0 * * *"
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
jobs:
|
|
|
|
- awesome
|
2019-04-30 08:33:54 -04:00
|
|
|
build-deploy:
|
|
|
|
jobs:
|
2019-04-30 10:04:20 -04:00
|
|
|
- awesome
|
2019-04-30 08:33:54 -04:00
|
|
|
- build
|
|
|
|
- deploy:
|
|
|
|
context: ipfs-dns-deploy
|
|
|
|
requires:
|
|
|
|
- build
|