Skip to content

Commit

Permalink
chore: publish client to firebase hosting automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
jbms committed Mar 18, 2024
1 parent cba1820 commit a672391
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
# Need full history to determine version number.
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.x
Expand All @@ -34,7 +37,10 @@ jobs:
- name: Typecheck with TypeScript
run: npm run typecheck
- name: Build client bundles
run: npm run build -- --no-typecheck --no-lint
run: |
build_info="{'tag':'$(git describe --always --tags)', 'url':'https://github.com/google/neuroglancer/commit/$(git rev-parse HEAD)', 'timestamp':'$(date)'}"
npm run build -- --no-typecheck --no-lint --define NEUROGLANCER_BUILD_INFO="${build_info}"
shell: bash
- name: Build Python client bundles
run: npm run build-python -- --no-typecheck --no-lint
- run: npm run build-package
Expand All @@ -51,6 +57,12 @@ jobs:
name: npm-package
path: dist/package
if: ${{ runner.os == 'Linux' }}
- name: Upload client as artifact
uses: actions/upload-artifact@v4
with:
name: client
path: dist/client
if: ${{ runner.os == 'Linux' }}

# Builds Python package and runs Python tests
#
Expand Down Expand Up @@ -183,6 +195,10 @@ jobs:
with:
name: npm-package
path: npm-package
- uses: actions/download-artifact@v4
with:
name: client
path: dist/client
# - name: Publish to PyPI (test server)
# uses: pypa/gh-action-pypi-publish@54b39fb9371c0b3a6f9f14bb8a67394defc7a806 # 2020-09-25
# with:
Expand All @@ -201,6 +217,13 @@ jobs:
# working-directory: npm-package
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to Firebase hosting
uses: FirebaseExtended/action-hosting-deploy@v0
with:
firebaseServiceAccount: "${{ secrets.FIREBASE_HOSTING_SERVICE_ACCOUNT_KEY }}"
projectId: neuroglancer-demo
if: ${{ startsWith(github.ref, 'refs/tags/v') }}

ngauth:
strategy:
matrix:
Expand Down

0 comments on commit a672391

Please sign in to comment.