Skip to content

Commit e0c9cdc

Browse files
authored
feat: bring back IPFS preview on PR (#13)
feat: bring back IPFS preview on PR
2 parents 2b341f2 + 9f48693 commit e0c9cdc

File tree

7 files changed

+6568
-3897
lines changed

7 files changed

+6568
-3897
lines changed

.circleci/config.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/node:10.15.1
6+
steps:
7+
- checkout
8+
- run:
9+
command: npm ci
10+
- run:
11+
command: npm run build
12+
- persist_to_workspace:
13+
root: .
14+
paths:
15+
- dist
16+
17+
deploy:
18+
docker:
19+
- image: olizilla/ipfs-dns-deploy:latest
20+
environment:
21+
DOMAIN: cid.ipfs.io
22+
BUILD_DIR: dist
23+
steps:
24+
- attach_workspace:
25+
at: /tmp/workspace
26+
- run:
27+
name: Deploy website to IPFS
28+
command: |
29+
pin_name="$DOMAIN build $CIRCLE_BUILD_NUMBER"
30+
31+
hash=$(pin-to-cluster.sh "$pin_name" /tmp/workspace/$BUILD_DIR)
32+
33+
echo "Website added to IPFS: https://ipfs.io/ipfs/$hash"
34+
35+
# Update DNSlink for prod or dev domain
36+
if [ "$CIRCLE_BRANCH" == "master" ] ; then
37+
dnslink-dnsimple -d $DOMAIN -r _dnslink -l /ipfs/$hash
38+
fi
39+
40+
workflows:
41+
version: 2
42+
build-deploy:
43+
jobs:
44+
- build
45+
- deploy:
46+
context: ipfs-dns-deploy
47+
requires:
48+
- build

Makefile

-4
This file was deleted.

ci/Jenkinsfile

-5
This file was deleted.

0 commit comments

Comments
 (0)