Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:12.16.1
steps:
- checkout
- run:
command: npm ci
- run:
command: npm run build
- persist_to_workspace:
root: .
paths:
- build

deploy:
docker:
- image: olizilla/ipfs-dns-deploy:latest
environment:
PROD_DOMAIN: share.ipfs.io
DEV_DOMAIN: dev.share.ipfs.io
BUILD_DIR: build
steps:
- attach_workspace:
at: /tmp/workspace
- run:
name: Deploy website to IPFS
command: |
pin_name="ipfs-share-files 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"

# Update DNSlink for prod or dev domain
if [ "$CIRCLE_BRANCH" == "production" ] ; then
dnslink-dnsimple -d $PROD_DOMAIN -r _dnslink -l /ipfs/$hash
fi
if [ "$CIRCLE_BRANCH" == "master" ] ; then
dnslink-dnsimple -d $DEV_DOMAIN -r _dnslink -l /ipfs/$hash
fi

workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
context: ipfs-dns-deploy
requires:
- build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ To build the app for production to the `build` folder:

### Deploy

We use [Jenkins](https://jenkins.io/) for automatic deployments. When a branch gets merged to `master`, it's deployed to [share.ipfs.io](https://share.ipfs.io). When merged to `develop`, it goes to [dev.share.ipfs.io](https://dev.share.ipfs.io).
We use CI for automatic deployments. When a branch gets merged to `master`, it's deployed to [dev.share.ipfs.io](https://dev.share.ipfs.io). When merged to `production`, it goes to [share.ipfs.io](https://share.ipfs.io).

## Translations

Expand Down
9 changes: 0 additions & 9 deletions ci/Jenkinsfile

This file was deleted.

2 changes: 1 addition & 1 deletion cors-config.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/env bash

ALLOW_ORIGINS='"http://localhost:3000", "https://share.ipfs.io"'

Expand Down