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

Feature/ci #9

Merged
merged 14 commits into from
Feb 26, 2024
Merged

Feature/ci #9

merged 14 commits into from
Feb 26, 2024

Conversation

alexb5dh
Copy link
Collaborator

@alexb5dh alexb5dh commented Feb 24, 2024

PR Changelog

Adds automatic backend deployment to AWS.

Features

  • Docker and docker-compose setup for backend
  • GitHub action to deploy backend to AWS
  • Small fixes for package dependencies
  • Fixes for npm run build producing invalid result
  • [BREAKING] Do not include file extensions to knex migrations table
    • Migration files extensions are different when solution is run via ts-node (.ts) or complied and executed using node (.js). This fix allows both environment to use the same database, regardless of migration files extension.
    • This is not backwards compatible - one will need to do a fresh database setup or remove file extensions from knex_migrations table manually.

Notes

  • For now the deploy action needs to be invoked manually from the Actions tab for the selected branch. Automatic run on push to master or a new tag can be easily added later.
  • Action will install dependencies, and run lint, prettier, and tests to ensure code is valid before the deployment itself.
  • Adding new variables:
    • From now on any new variable will need to be added to both .env.local and .env.dev files.
    • Non-public variables need to be saved to the repository secrets using INPUT_ prefix and referenced in the .env.dev file, for example as: DB_URI=${INPUT_DB_URI?error} (?error here forces Docker Compose to fail if variable is not set).

@alexb5dh alexb5dh self-assigned this Feb 24, 2024
@alexb5dh alexb5dh force-pushed the feature/ci branch 5 times, most recently from 0669325 to 8798cfc Compare February 25, 2024 16:17
@alexb5dh alexb5dh force-pushed the feature/ci branch 2 times, most recently from 435ea3c to 5dd543b Compare February 26, 2024 06:45
@alexb5dh alexb5dh marked this pull request as ready for review February 26, 2024 06:56
Copy link
Contributor

@samtin0x samtin0x left a comment

Choose a reason for hiding this comment

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

I haven't tested it, trusting you this works, code looks good

@alexb5dh alexb5dh merged commit def7911 into main Feb 26, 2024
3 checks passed
@samtin0x samtin0x deleted the feature/ci branch February 28, 2024 16:58
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.

2 participants