-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
83 lines (72 loc) · 1.94 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
image: node:18-bullseye
stages:
- check
- test
- deploy
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- node_modules
- .pnpm-store
# include this where you need it. like in before_script
.install-ipfs-and-setup: &install-ipfs-and-setup
- echo "Downloading anagolay ipfs CLI which works with the ipfsAuthProxy."
- curl https://ipfs.anagolay.network/ipfs/bafybeig634knkl57gqgkmh3fti6zxisfcd47swetf5lastcx2waboa4a4a > /usr/local/bin/ipfsCli
- chmod +x /usr/local/bin/ipfsCli
# https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#yaml-anchors-for-scripts
.install-pnpm:
&install-pnpm #- curl https://ipfs.anagolay.network/ipfs/bafybeigpvp624p2ly2c44twyvalrwdzb5sehntwk3zzrvb4ht6qh56atha > /usr/local/bin/pnpm
- curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7
- pnpm config set store-dir .pnpm-store
- node --version
- pnpm --version
- git --version
is-it-pretty:
stage: check
before_script:
- *install-pnpm
script:
- pnpm install
- pnpm lint
build-code:
stage: test
needs: ['is-it-pretty']
before_script:
- *install-pnpm
script:
- pnpm install
- pnpm build
upload-to-ipfs:
needs: ['is-it-pretty']
stage: deploy
cache: {}
before_script:
- *install-ipfs-and-setup
- *install-pnpm
script:
- set -e
- pnpm install
- echo 'Building ...'
- pnpm build
- echo "Uploading to IPFS ..."
- IPFS_PIN=true ipfsCli add --pin --onlyCid build > ANAGOLAY_WEBSITE_CID
- echo "The Website is published with the CID:" && cat ANAGOLAY_WEBSITE_CID
- echo "https://$(cat ANAGOLAY_WEBSITE_CID).ipfs.anagolay.network/"
# when: manual
# rules:
# - if: $CI_COMMIT_MESSAGE =~ /^.*\[build all\].*$/s
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
pages:
needs: ['is-it-pretty']
stage: deploy
before_script:
- *install-pnpm
script:
- pnpm install
- pnpm build
- mv build public
artifacts:
paths:
- public
only:
- main