Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/publish-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: publish-deploy
on:
push:
branches: [develop]
tags: [v*]

jobs:
publish-npm:
Expand All @@ -18,12 +19,14 @@ jobs:
scope: "@epfml"
- run: npm ci
- run: npm --workspace=discojs{,-node,-web} version prerelease --preid=p`date +%Y%m%d%H%M%S`
if: github.ref_type == 'branch'
- run: npm --workspace=discojs{,-node,-web} run build
- run: npm --workspace=discojs{,-node,-web} publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

build-webapp:
if: github.ref_type == 'branch'
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -40,6 +43,7 @@ jobs:
path: webapp/dist
deploy-pages:
needs: build-webapp
if: github.ref_type == 'branch'
runs-on: ubuntu-latest
permissions:
pages: write
Expand Down Expand Up @@ -68,6 +72,9 @@ jobs:
id: meta
with:
images: ghcr.io/epfml/disco
tags: |
type=semver,pattern={{version}}
type=edge
- uses: docker/build-push-action@v5
id: build
with:
Expand All @@ -77,6 +84,7 @@ jobs:

deploy-server:
needs: [publish-github-container]
if: github.ref_type == 'branch'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
49 changes: 36 additions & 13 deletions docs/DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,46 @@
# Deployment
# Releases

This automation happens via [a workflow of our CI](../.github/workflows/publish-deploy.yml).

## Normal development

Every merge to the default branch (`develop`) releases
a patch version of the NPM packages (`discojs`, `discojs-node` & `discojs-web`).

It will also create a
[container image](<https://en.wikipedia.org/wiki/Containerization_(computing)>)
using the repo's [Dockerfile](https://docs.docker.com/reference/dockerfile/)
which gets pushed to [GitHub Packages](https://docs.github.com/en/packages)
under the [`edge`](https://github.com/epfml/disco/pkgs/container/disco/edge) tag.

We are maintaining two services, the [webapp](https://discolab.ai/) and the [server](https://disco-zbkj3i466a-oa.a.run.app/).
Both are automatically deployed when pushing to the default branch (`develop`) via [a workflow of our CI](../.github/workflows/publish-deploy.yml).
The webapp is first built using a classic `npm -ws run build`
which gets deployed to GitHub Pages, with a
[custom domain](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site).

## webapp
## Release

It is first built using a classic `npm -ws run build`.
Then is gets deployed to GitHub Pages,
with a [custom domain](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site).
When tagging a commit with a "v" prefix, more is happening.

## server
- NPM packages get released without a patch postfix
- a container is built for that version and gets released under that tag,
minus the "v" prefix

When you want to do a release, be sure that the commit that you're tagging
is the one changing version number in the various "package.json".

If you want to add release notes, take a look in
[the dedicated GitHub page](https://github.com/epfml/disco/releases)
after pushing the tag.

# Deployment

First, a [container image](<https://en.wikipedia.org/wiki/Containerization_(computing)>) is built
using the repo's [Dockerfile](https://docs.docker.com/reference/dockerfile/).
It gets pushed to [GitHub Packages](https://docs.github.com/en/packages).
We are maintaining two services, the [webapp](https://discolab.ai/)
and the [server](https://disco-zbkj3i466a-oa.a.run.app/).

It is then deployed to [Google Cloud via Cloud Run](https://cloud.google.com/run).
The server is using the previously built container deployed on
[Google Cloud via Cloud Run](https://cloud.google.com/run).

### Google Cloud specifics
## Google Cloud specifics

The GitHub Action runner is authenticated via a
[Direct Workload Identity Federation](https://github.com/google-github-actions/auth?tab=readme-ov-file#preferred-direct-workload-identity-federation)
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "server",
"private": true,
"version": "2.1.1",
"type": "module",
"main": "dist/index.js",
"bin": {
Expand Down