Skip to content

Commit

Permalink
now based on webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisj committed Apr 18, 2024
1 parent a288eb6 commit 25ca8ce
Show file tree
Hide file tree
Showing 19 changed files with 5,771 additions and 5,220 deletions.
118 changes: 58 additions & 60 deletions .github/workflows/on_dev_branch_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,67 @@ name: BuildAndDeployDevBranch
on:
push:
branches-ignore:
- 'master'
- "master"
jobs:
build-and-deploy:
permissions:
contents: 'read'
id-token: 'write'
deployments: 'write'
contents: "read"
id-token: "write"
deployments: "write"
strategy:
matrix:
node-version:
- '16.x'
matrix:
node-version:
- "20.x"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ matrix.node-version }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- run: npm install
- name: Typecheck with TypeScript
run: npm run typecheck
- name: Build client bundles
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")
- run: cp -r ./dist/min appengine/frontend/static/
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
- run: echo "BRANCH_NAME_URL=$(echo ${{ env.BRANCH_NAME }} | tr / - | tr _ -)" >> $GITHUB_ENV
- name: start deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ env.BRANCH_NAME }}
desc: Setting up staging deployment for ${{ env.BRANCH_NAME }}
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: 'projects/483670036293/locations/global/workloadIdentityPools/neuroglancer-github/providers/github'
service_account: '[email protected]'
- id: deploy
uses: google-github-actions/deploy-appengine@main
with:
version: ${{ env.BRANCH_NAME_URL }}
deliverables: appengine/frontend/app.yaml
promote: false
- name: update deployment status
uses: bobheadxi/deployments@v1
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ steps.deployment.outputs.env }}
env_url: ${{ steps.deploy.outputs.url }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ matrix.node-version }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- run: npm install
- name: Build client bundles
run: npm run build
- run: cp -r ./dist appengine/frontend/static/
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
- run: echo "BRANCH_NAME_URL=$(echo ${{ env.BRANCH_NAME }} | tr / - | tr _ -)" >> $GITHUB_ENV
- name: start deployment
uses: bobheadxi/deployments@v1
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ env.BRANCH_NAME }}
desc: Setting up staging deployment for ${{ env.BRANCH_NAME }}
- id: "auth"
uses: "google-github-actions/auth@v1"
with:
workload_identity_provider: "projects/483670036293/locations/global/workloadIdentityPools/neuroglancer-github/providers/github"
service_account: "[email protected]"
- id: deploy
uses: google-github-actions/deploy-appengine@main
with:
version: ${{ env.BRANCH_NAME_URL }}
deliverables: appengine/frontend/app.yaml
promote: false
- name: update deployment status
uses: bobheadxi/deployments@v1
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ steps.deployment.outputs.env }}
env_url: ${{ steps.deploy.outputs.url }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
41 changes: 14 additions & 27 deletions appengine/frontend/app.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
runtime: python27
api_version: 1
threadsafe: true

# The skip_files element specifies which files
# in the application directory are not to be
# uploaded to App Engine.
skip_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$
- ^node_modules$
runtime: python312

service: ngextend

handlers:
# Handle the main page by serving the index page.
# Note the $ to specify the end of the path, since app.yaml does prefix matching.
- url: /$
static_files: static/index.html
upload: static/index.html
login: optional
secure: always
redirect_http_response_code: 301
# Handle the main page by serving the index page.
# Note the $ to specify the end of the path, since app.yaml does prefix matching.
- url: /$
static_files: static/index.html
upload: static/index.html
login: optional
secure: always
redirect_http_response_code: 301

- url: /
static_dir: static
login: optional
secure: always
redirect_http_response_code: 301
- url: /
static_dir: static
login: optional
secure: always
redirect_http_response_code: 301
Loading

0 comments on commit 25ca8ce

Please sign in to comment.