-
Notifications
You must be signed in to change notification settings - Fork 147
173 lines (171 loc) · 6.08 KB
/
master-deployment.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Test/Deploy Master
on:
push:
branches: [master]
jobs:
build-test:
runs-on: neodash-runners
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Creating Neo4j Container
run: |
chmod +x ./scripts/docker-neo4j-initializer/docker-neo4j.sh
./scripts/docker-neo4j-initializer/docker-neo4j.sh
sleep 30s
chmod +x ./scripts/docker-neo4j-initializer/start-movies-db.sh
./scripts/docker-neo4j-initializer/start-movies-db.sh
- run: yarn install
- name: Eslint check
run: yarn run lint
- name: Cypress run
uses: cypress-io/github-action@v4
with:
build: yarn run build
start: yarn run dev
wait-on: 'http://localhost:3000'
browser: chrome
build-s3:
needs: build-test
runs-on: neodash-runners
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: rm -rf docs
- run: yarn install
- run: yarn run build-minimal
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- run: curl ${{ secrets.INDEX_HTML_DEPLOYMENT_URL }} > dist/index.html
- run: aws s3 rm s3://neodash.graphapp.io/ --recursive && aws s3 sync dist s3://neodash.graphapp.io/ --acl public-read
build-docker:
needs: build-test
runs-on: neodash-runners
strategy:
matrix:
node-version: [18.x]
steps:
- name: run Docker
uses: actions/checkout@v2
- run: rm -rf docs
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_LABS_USERNAME }}
password: ${{ secrets.DOCKER_HUB_LABS_ACCESS_TOKEN }}
- name: Set up Docker Build
uses: docker/setup-buildx-action@v1
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_LABS_USERNAME }}/neodash:2.4.9
build-docker-legacy:
needs: build-test
runs-on: neodash-runners
strategy:
matrix:
node-version: [18.x]
steps:
- name: run Docker
uses: actions/checkout@v2
- run: rm -rf docs
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/neodash:latest,${{ secrets.DOCKER_HUB_USERNAME }}/neodash:2.4.9
deploy-gallery:
runs-on: neodash-runners
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: cd gallery && yarn install
- run: cd gallery && yarn run build
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
- run: aws s3 rm s3://neodash-gallery.graphapp.io/ --recursive && aws s3 sync gallery/build s3://neodash-gallery.graphapp.io/ --acl public-read
deploy-docs:
needs: build-test
runs-on: neodash-runners
steps:
- name: Trigger Developer Event
uses: peter-evans/repository-dispatch@main
with:
token: ${{ secrets.DOCS_REFRESH_TOKEN }}
repository: neo4j-documentation/docs-refresh
event-type: labs
build-npm:
needs: build-test
runs-on: neodash-runners
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: rm -rf docs
- run: yarn install
- run: PRODUCTION=true && yarn run build-minimal
- run: curl ${{ secrets.INDEX_HTML_DEPLOYMENT_URL }} > dist/index.html
- run: npm pack
- run: rm -rf target
- run: mkdir target
- run: mv *.tgz target/
- run: tar -xvf target/*.tgz
- run: rm -f target/*.tgz
- run: cp package/dist/favicon.ico package/favicon.ico
- run: echo "${{ secrets.NEO4J_LABS_APP_KEY }}" > neo4j-labs-app.pem
- run: echo "${{ secrets.NEO4J_LABS_APP_CERTIFICATE }}" > neo4j-labs-app.cert
- run: npx @neo4j/code-signer --app ./package --private-key neo4j-labs-app.pem --cert neo4j-labs-app.cert --passphrase ${{ secrets.NEO4J_DESKTOP_PASSPHRASE }}
- run: echo "${{ secrets.NEO4J_DESKTOP_CERTIFICATE }}" > neo4j_desktop.cert
- run: npx @neo4j/code-signer --verify --app ./package --root-cert neo4j_desktop.cert
- run: cd package && npm pack
- run: mv package/*.tgz .
- run: rm -rf package
- run: tar xvf *.tgz package
- run: npx @neo4j/code-signer --verify --app ./package --root-cert neo4j_desktop.cert
- run: rm -rf package
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: Publish package to NPM 📦
run: npm publish --access public neodash*.tgz