-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
executable file
·79 lines (71 loc) · 1.71 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
executable file
·79 lines (71 loc) · 1.71 KB
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
image: node:16-bullseye
stages:
- check
- build
- deploy
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- node_modules
- .pnpm-store
- public
# 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
- npm install -g pnpm
- pnpm config set store-dir .pnpm-store
is-it-pretty:
stage: check
before_script:
- *install-pnpm
script:
- pnpm install
- pnpm lint
build:
stage: build
needs: ['is-it-pretty']
before_script:
- *install-pnpm
script:
- pnpm install
- pnpm build
artifacts:
name: '${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}'
when: on_success
expire_in: 2 hours
paths:
- build/
upload-to-ipfs:
needs:
- job: build
artifacts: true
cache: {}
stage: deploy
before_script:
- *install-ipfs-and-setup
script:
- echo "Uploading to IPFS ..."
- IPFS_PIN=false ipfsCli add --pin --onlyCid build > DOCS_CID
- echo "The Website is published with the CID:" && cat DOCS_CID
- echo "https://$(cat DOCS_CID).ipfs.anagolay.network/"
# when: manual
# rules:
# - if: $CI_COMMIT_MESSAGE =~ /^.*\[build all\].*$/s
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
pages:
needs:
- job: build
artifacts: true
cache: {}
stage: deploy
script:
- mv build public
artifacts:
paths:
- public
only:
- main