Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment Strategy #290

Open
kamiyo opened this issue Aug 14, 2023 · 1 comment
Open

Deployment Strategy #290

kamiyo opened this issue Aug 14, 2023 · 1 comment
Assignees

Comments

@kamiyo
Copy link
Collaborator

kamiyo commented Aug 14, 2023

For the new version, here is what I'm thinking:

Frontend

In a GitHub action:

  1. Build web and admin with vite build
  2. Copy via rsync (pass option to clean the dest folder) the build artifacts into ASSETS_DIR/web and ASSETS_DIR/admin on remote. ASSETS_DIR can be set in GitHub secrets. Make sure other assets copied, too.

Backend

In a GitHub action:

  1. Build docker image
  2. Push to docker hub (in same step with buildx, probably)
  3. DB Migration
    A. SSH to remote with tunnel
    B. Use tunnel port with dbmate to run migration (set the DATABASE_URL in secrets)
  4. Within ssh? Pull latest docker image from hub, perhaps using a docker-compose?
  5. Dockerfile will automatically run node app (don't forget to set envs)

Reasoning

Cannot bundle backend code because certain libraries (sharp) cannot be bundled, having binary code. Selective extracting of repo from monorepo hasn't been successful (turborepo outside of docker, yarn.build creates huge zip, yarn pack doesn't do what I expect).

@kamiyo
Copy link
Collaborator Author

kamiyo commented Aug 17, 2023

Implemented backend build action in #291.

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

No branches or pull requests

3 participants