Skip to content

Commit 25ca8ce

Browse files
committed
now based on webpack
1 parent a288eb6 commit 25ca8ce

19 files changed

+5771
-5220
lines changed

.github/workflows/on_dev_branch_push.yml

+58-60
Original file line numberDiff line numberDiff line change
@@ -3,69 +3,67 @@ name: BuildAndDeployDevBranch
33
on:
44
push:
55
branches-ignore:
6-
- 'master'
6+
- "master"
77
jobs:
88
build-and-deploy:
99
permissions:
10-
contents: 'read'
11-
id-token: 'write'
12-
deployments: 'write'
10+
contents: "read"
11+
id-token: "write"
12+
deployments: "write"
1313
strategy:
14-
matrix:
15-
node-version:
16-
- '16.x'
14+
matrix:
15+
node-version:
16+
- "20.x"
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v2
20-
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v1
22-
with:
23-
node-version: ${{ matrix.node-version }}
24-
- uses: actions/cache@v3
25-
with:
26-
path: "**/node_modules"
27-
key: ${{ runner.os }}-${{ matrix.node-version }}-node_modules-${{ hashFiles('**/package-lock.json') }}
28-
- run: npm install
29-
- name: Typecheck with TypeScript
30-
run: npm run typecheck
31-
- name: Build client bundles
32-
run: node ./node_modules/neuroglancer/config/esbuild-cli.js --config=min --no-typecheck --define CONFIG=$(cat config/ng-extend.json | tr -d ' \t\n\r') --define STATE_SERVERS=$(cat config/state_servers.json | tr -d " \t\n\r") --define CUSTOM_BINDINGS=$(cat config/custom-keybinds.json | tr -d " \t\n\r")
33-
- run: cp -r ./dist/min appengine/frontend/static/
34-
- name: Get branch name (merge)
35-
if: github.event_name != 'pull_request'
36-
shell: bash
37-
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
38-
- name: Get branch name (pull request)
39-
if: github.event_name == 'pull_request'
40-
shell: bash
41-
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
42-
- run: echo "BRANCH_NAME_URL=$(echo ${{ env.BRANCH_NAME }} | tr / - | tr _ -)" >> $GITHUB_ENV
43-
- name: start deployment
44-
uses: bobheadxi/deployments@v1
45-
id: deployment
46-
with:
47-
step: start
48-
token: ${{ secrets.GITHUB_TOKEN }}
49-
env: ${{ env.BRANCH_NAME }}
50-
desc: Setting up staging deployment for ${{ env.BRANCH_NAME }}
51-
- id: 'auth'
52-
uses: 'google-github-actions/auth@v1'
53-
with:
54-
workload_identity_provider: 'projects/483670036293/locations/global/workloadIdentityPools/neuroglancer-github/providers/github'
55-
service_account: '[email protected]'
56-
- id: deploy
57-
uses: google-github-actions/deploy-appengine@main
58-
with:
59-
version: ${{ env.BRANCH_NAME_URL }}
60-
deliverables: appengine/frontend/app.yaml
61-
promote: false
62-
- name: update deployment status
63-
uses: bobheadxi/deployments@v1
64-
if: always()
65-
with:
66-
step: finish
67-
token: ${{ secrets.GITHUB_TOKEN }}
68-
env: ${{ steps.deployment.outputs.env }}
69-
env_url: ${{ steps.deploy.outputs.url }}
70-
status: ${{ job.status }}
71-
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- uses: actions/cache@v3
25+
with:
26+
path: "**/node_modules"
27+
key: ${{ runner.os }}-${{ matrix.node-version }}-node_modules-${{ hashFiles('**/package-lock.json') }}
28+
- run: npm install
29+
- name: Build client bundles
30+
run: npm run build
31+
- run: cp -r ./dist appengine/frontend/static/
32+
- name: Get branch name (merge)
33+
if: github.event_name != 'pull_request'
34+
shell: bash
35+
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
36+
- name: Get branch name (pull request)
37+
if: github.event_name == 'pull_request'
38+
shell: bash
39+
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
40+
- run: echo "BRANCH_NAME_URL=$(echo ${{ env.BRANCH_NAME }} | tr / - | tr _ -)" >> $GITHUB_ENV
41+
- name: start deployment
42+
uses: bobheadxi/deployments@v1
43+
id: deployment
44+
with:
45+
step: start
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
env: ${{ env.BRANCH_NAME }}
48+
desc: Setting up staging deployment for ${{ env.BRANCH_NAME }}
49+
- id: "auth"
50+
uses: "google-github-actions/auth@v1"
51+
with:
52+
workload_identity_provider: "projects/483670036293/locations/global/workloadIdentityPools/neuroglancer-github/providers/github"
53+
service_account: "[email protected]"
54+
- id: deploy
55+
uses: google-github-actions/deploy-appengine@main
56+
with:
57+
version: ${{ env.BRANCH_NAME_URL }}
58+
deliverables: appengine/frontend/app.yaml
59+
promote: false
60+
- name: update deployment status
61+
uses: bobheadxi/deployments@v1
62+
if: always()
63+
with:
64+
step: finish
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
env: ${{ steps.deployment.outputs.env }}
67+
env_url: ${{ steps.deploy.outputs.url }}
68+
status: ${{ job.status }}
69+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}

appengine/frontend/app.yaml

+14-27
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,19 @@
1-
runtime: python27
2-
api_version: 1
3-
threadsafe: true
4-
5-
# The skip_files element specifies which files
6-
# in the application directory are not to be
7-
# uploaded to App Engine.
8-
skip_files:
9-
- ^(.*/)?#.*#$
10-
- ^(.*/)?.*~$
11-
- ^(.*/)?.*\.py[co]$
12-
- ^(.*/)?.*/RCS/.*$
13-
- ^(.*/)?\..*$
14-
- ^node_modules$
1+
runtime: python312
152

163
service: ngextend
174

185
handlers:
19-
# Handle the main page by serving the index page.
20-
# Note the $ to specify the end of the path, since app.yaml does prefix matching.
21-
- url: /$
22-
static_files: static/index.html
23-
upload: static/index.html
24-
login: optional
25-
secure: always
26-
redirect_http_response_code: 301
6+
# Handle the main page by serving the index page.
7+
# Note the $ to specify the end of the path, since app.yaml does prefix matching.
8+
- url: /$
9+
static_files: static/index.html
10+
upload: static/index.html
11+
login: optional
12+
secure: always
13+
redirect_http_response_code: 301
2714

28-
- url: /
29-
static_dir: static
30-
login: optional
31-
secure: always
32-
redirect_http_response_code: 301
15+
- url: /
16+
static_dir: static
17+
login: optional
18+
secure: always
19+
redirect_http_response_code: 301

0 commit comments

Comments
 (0)