Skip to content

ci: setup frontend s3 deployment and migrate backend container registry - #518

Merged
kshitijrajsharma merged 2 commits into
hotosm:developfrom
yshmael:feature/fair-prod
Jul 27, 2026
Merged

ci: setup frontend s3 deployment and migrate backend container registry#518
kshitijrajsharma merged 2 commits into
hotosm:developfrom
yshmael:feature/fair-prod

Conversation

@yshmael

@yshmael yshmael commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

1. Backend OCI Namespace Migration

  • Updated the Docker build/push workflow to target ghcr.io/hotosm/fair/backend instead of the root fair-api namespace. This keeps the image properly nested under the fAIr repository and stops it from cluttering the main HOT OSM organization registry.

2. Production Frontend Deployment Workflow

  • Added .github/workflows/deploy_frontend_s3.yml to automatically build the Vite app and sync it to the new AWS production infrastructure on main merges.

Frontend Workflow Highlights:

  • Keyless Auth: Uses the GitHub-AWS OIDC role so we don't have to manage long-lived AWS keys.
  • Environment Vars: Injects the correct production VITE_ variables (Hanko auth, base API URLs) at build time.
  • Smart Caching: Syncs static assets with a 1-year immutable cache, but explicitly forces no-cache on index.html. This ensures users never get stuck on a stale version of the app.
  • Auto-Invalidation: Dynamically looks up the CloudFront distribution ID for fair.hotosm.org and triggers a cache clear automatically.

Note for Reviewer

This workflow pairs with the pending k8s-infra PR. Once the admin approves and applies the AWS infrastructure changes over there, this pipeline is ready to take over the frontend deployments.

@kshitijrajsharma kshitijrajsharma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be nice workflow however frontend workflow is now outdated ( kindly refer to the PR links I have attached ), Same for the renaming of the images published , optional nice to have but i think API is kinda clear already !
cc : @spwoodcock @dakotabenjamin

Comment thread .github/workflows/deploy_frontend_s3.yml
context: backend/
dockerfile: Dockerfile
image_name: ghcr.io/${{ github.repository_owner }}/fair-api
image_name: ghcr.io/${{ github.repository_owner }}/fair/backend

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think api is clear namespace than backend ! Optional changes ~

context: backend/
dockerfile: Dockerfile
image_name: ghcr.io/${{ github.repository_owner }}/fair-api
image_name: ghcr.io/${{ github.repository_owner }}/fair/backend

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here ! Optional changes ~

@kshitijrajsharma

Copy link
Copy Markdown
Member

if we want to rename the packages , we should rename them all to follow same convention
image

@spwoodcock

Copy link
Copy Markdown
Member

My bad here - it was my suggestion to rename in a k8s-infra PR! I didn't realise this was the convention being used.

Either is fine, I just thought instead of
hotosm/fair-xxx we could have hotosm/fair/xxx images, to better denote them as images under the fair repo.

We do this for quite a few other tools, but its not a big deal - say whatever you think its best @kshitijrajsharma 🙏

@kshitijrajsharma

Copy link
Copy Markdown
Member

My bad here - it was my suggestion to rename in a k8s-infra PR! I didn't realise this was the convention being used.

Either is fine, I just thought instead of hotosm/fair-xxx we could have hotosm/fair/xxx images, to better denote them as images under the fair repo.

We do this for quite a few other tools, but its not a big deal - say whatever you think its best @kshitijrajsharma 🙏

No worries yes they can be removed , we can be consistent across the tools !

@kshitijrajsharma kshitijrajsharma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Responding to above comment from sam , You can keep the backend build ( may be rename it to fair/api ) and publish container image yaml

i will raise a PR to fix all the naming

@kshitijrajsharma
kshitijrajsharma merged commit a301535 into hotosm:develop Jul 27, 2026
@kshitijrajsharma

Copy link
Copy Markdown
Member

Merging this as production will be served by cloudfront

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants