ED-NEWP / galos

0 stars 0 forks source link

chore(CD): Add a CD workflow #20

Closed yevk closed 3 years ago

yevk commented 3 years ago

Adding a GitHub Actions CD workflow that builds a release version of galos-sync, Dockerizes it and pushes to an AWS ECR registry.

Changes the use of dotenv to ignore if the .env file is missing.

yevk commented 3 years ago

@nixpulvis Note that the files have changed since you last reviewed them. Mainly the root README file and the new DevOps README file.

nixpulvis commented 3 years ago

For migrations we need to create a new docker image on each push when the push contains new files inside the migrations folder (only checking for new is OK since old files should never change). The image must include the needed components to run the migrations, so sqlx-cli and galos_db/migrations/ are both required. Running this image should call sqlx-cli migrate as an entry point, possible pointing to the migrations folder (if it's not in the same directory) as an arg.

Each run of the docker image will need to specify the DATABASE_URL which the migrations will be run on.

Additionally, this new image should be added to the docker-compose.yml so a simple docker compose up will fetch the latest versions as expected.

nixpulvis commented 3 years ago

Dealing with migrations will be a separate task to automate. This means that was cannot blindly deploy these docker builds. If a new build is pushed which requires a migration, we will have to manually run it before pulling and restarting the latest image.

nixpulvis commented 3 years ago

I don't have the patience to learn the horrible nonsense that is Docker.