DEV Community

Daniel Mita
Daniel Mita

Posted on

Building and Deploying a New API (Part 2)

Previous Post

Now that the server code has been written, we move on to creating and building the Docker image. There's nothing particularly special about it yet, it simply runs go build to create the binary, and copies it over to a scratch image (simple is good)!

Repository tooling comes next. The first being the workflow to build and push our Docker image. This is another fairly straightforward step, following along with the documentation along with some minor tweaks.

Another tool we'll be including is Codecov. The workflow is set up to run all the tests, generate a code coverage file, and use an API key to push the results over to Codecov. We also have a YAML file with some settings to exclude the generated code from the results.

Codecov comment

And finally, to check for repository updates, we'll also set up Dependabot to look at our GitHub Actions and Docker files.

Nothing particularly complicated for this post, but all of these tools have their uses, and I definitely believe they're worth trying at the very least!

The state of the repository as of this post can be found here.

A link to the next part will be available once it is written.

Top comments (0)