-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added github action to build and deploy to app engine
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: BuildAndDeploy | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '10.x' | ||
- run: git submodule init | ||
- run: git submodule update | ||
- run: npm i | ||
- run: cd third_party/neuroglancer/ && npm i && cd ../. | ||
- run: npm run build | ||
- run: cp -r ./dist/dev appengine/frontend/static/ | ||
- name: Extract branch name | ||
id: get_branch | ||
shell: bash | ||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/} | tr / - | tr _ -)" | ||
- run: echo ${{ steps.get_branch.outputs.branch }} | ||
- name: deploy to gcloud master | ||
if: steps.get_branch.outputs.branch == 'master' | ||
uses: actions-hub/[email protected] | ||
env: | ||
PROJECT_ID: seung-lab | ||
APPLICATION_CREDENTIALS: ${{ secrets.SA_GOOGLE_APPS_DEPLOY }} | ||
with: | ||
args: app deploy appengine/frontend/app.yaml --promote --version ${{ steps.get_branch.outputs.branch }} | ||
- name: deploy to gcloud dev branch | ||
if: steps.get_branch.outputs.branch != 'master' | ||
uses: actions-hub/[email protected] | ||
env: | ||
PROJECT_ID: seung-lab | ||
APPLICATION_CREDENTIALS: ${{ secrets.SA_GOOGLE_APPS_DEPLOY }} | ||
with: | ||
args: app deploy appengine/frontend/app.yaml --no-promote --version ${{ steps.get_branch.outputs.branch }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
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$ | ||
|
||
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 | ||
|
||
- url: / | ||
static_dir: static | ||
login: optional | ||
secure: always | ||
redirect_http_response_code: 301 |