From 9af4d3702239093597d3f0676d8c79fe998a302b Mon Sep 17 00:00:00 2001 From: ascibisz Date: Wed, 10 Dec 2025 14:00:18 -0800 Subject: [PATCH 1/4] add test workflow for deploying to production --- .github/workflows/deploy-prod.yml | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/deploy-prod.yml diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml new file mode 100644 index 00000000..a2156d53 --- /dev/null +++ b/.github/workflows/deploy-prod.yml @@ -0,0 +1,41 @@ +name: deploy-prod +run-name: Deploy to Production +on: pull_request + +env: + AWS_REGION: ${{ vars.AWS_DEFAULT_REGION }} + AWS_ACCOUNT_ID: ${{ vars.AWS_CELLS_ACCOUNT_ID }} + +# Permissions required for the workflow to interact with AWS via OIDC +permissions: + id-token: write + contents: read + +jobs: + deploy-preview: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Add SHORT_SHA env property with commit short sha + run: echo "SHORT_SHA=`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_ENV + + - name: Configure AWS credentials with OIDC + uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 + with: + role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/github_cellpack + role-session-name: github_cellpack-${{ env.SHORT_SHA }} + aws-region: ${{ env.AWS_REGION }} + + - name: Set up Bun + uses: oven-sh/setup-bun@v2 + + - name: Install + run: bun install + + - name: Build with Vite + run: bun run build + + - name: Copy files to production bucket + run: aws s3 sync ./dist/ s3://cellpack-results/test/test-gh-action/ --delete From c8ae08fff1f26952e2b63e7597557aa94775c86d Mon Sep 17 00:00:00 2001 From: ascibisz Date: Wed, 10 Dec 2025 14:03:26 -0800 Subject: [PATCH 2/4] change bucket --- .github/workflows/deploy-prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index a2156d53..044038d1 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -38,4 +38,4 @@ jobs: run: bun run build - name: Copy files to production bucket - run: aws s3 sync ./dist/ s3://cellpack-results/test/test-gh-action/ --delete + run: aws s3 sync ./dist/ s3://cellpack-datasets/test-deploy/ --delete From 54b92334bcfdbff06fc146375c41e39bfedbdbbf Mon Sep 17 00:00:00 2001 From: ascibisz Date: Wed, 10 Dec 2025 16:55:54 -0800 Subject: [PATCH 3/4] move deploy prod action into build-and-deploy --- .github/workflows/build-and-deploy.yml | 35 +++++++++++++++++++++- .github/workflows/deploy-prod.yml | 41 -------------------------- 2 files changed, 34 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/deploy-prod.yml diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 0d5e8776..3d6c3ce1 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -7,13 +7,17 @@ on: push: branches: ['main'] +env: + AWS_REGION: ${{ vars.AWS_DEFAULT_REGION }} + AWS_ACCOUNT_ID: ${{ vars.AWS_CELLS_ACCOUNT_ID }} + permissions: contents: write pages: write id-token: write jobs: - build: + deploy-staging: runs-on: ubuntu-latest steps: - name: Checkout @@ -34,3 +38,32 @@ jobs: folder: ./dist clean-exclude: pr-preview/ branch: gh-pages + + deploy-prod: + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Add SHORT_SHA env property with commit short sha + run: echo "SHORT_SHA=`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_ENV + + - name: Configure AWS credentials with OIDC + uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 + with: + role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/github_cellpack + role-session-name: github_cellpack-${{ env.SHORT_SHA }} + aws-region: ${{ env.AWS_REGION }} + + - name: Set up Bun + uses: oven-sh/setup-bun@v2 + + - name: Install + run: bun install + + - name: Build with Vite + run: bun run build + + - name: Copy files to production bucket + run: aws s3 sync ./dist/ s3://cellpack-datasets/ --delete diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml deleted file mode 100644 index 044038d1..00000000 --- a/.github/workflows/deploy-prod.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: deploy-prod -run-name: Deploy to Production -on: pull_request - -env: - AWS_REGION: ${{ vars.AWS_DEFAULT_REGION }} - AWS_ACCOUNT_ID: ${{ vars.AWS_CELLS_ACCOUNT_ID }} - -# Permissions required for the workflow to interact with AWS via OIDC -permissions: - id-token: write - contents: read - -jobs: - deploy-preview: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Add SHORT_SHA env property with commit short sha - run: echo "SHORT_SHA=`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_ENV - - - name: Configure AWS credentials with OIDC - uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 - with: - role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/github_cellpack - role-session-name: github_cellpack-${{ env.SHORT_SHA }} - aws-region: ${{ env.AWS_REGION }} - - - name: Set up Bun - uses: oven-sh/setup-bun@v2 - - - name: Install - run: bun install - - - name: Build with Vite - run: bun run build - - - name: Copy files to production bucket - run: aws s3 sync ./dist/ s3://cellpack-datasets/test-deploy/ --delete From 5d3764937945678992eee2627f0b7c18ef284790 Mon Sep 17 00:00:00 2001 From: ascibisz Date: Thu, 11 Dec 2025 10:22:11 -0800 Subject: [PATCH 4/4] Add documentation for how to deploy --- CONTRIBUTING.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71c00f1c..9bad934d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,6 +29,22 @@ Typical steps to contribute: 4. Submit a pull request to merge your fork's branch into this repository, via GitHub. +## Deployment + +#### Staging deployment +Automatically builds from `main` +- [Staging site](https://allencell.github.io/cellpack-client/) + +#### Production deployment +Make sure the main branch is checked out and all desired changes are merged. Then: +1. Make a new version: `bun pm version [patch/minor/major]` -- this will give you the new tag, e.g., `1.3.2` +2. Push the new package.json version: `git push origin main` +3. Push the new tag: `git push origin [NEW_TAG]` -- e.g. `git push origin v1.3.2` +4. Write up [release notes](https://github.com/AllenCell/cellpack-client/releases). + - Select the tag + - Click "generate release notes" + - Use this template to summarize changes (delete any categories that aren't relevant) + ## Questions or Thoughts? Talk to us on [one of our community forums][community].