monitorizare-vot icon indicating copy to clipboard operation
monitorizare-vot copied to clipboard

new github action build-push-action for docker development

Open mirceachira opened this issue 4 years ago • 0 comments

What does it fix?

Closes #270

I added a build and publish workflow that triggers on pushes to master or develop. These will occur when pushing directly or when merging a pull request. Note that it won't occur if a pr is only created. It will always push with the 'latest' tag

You will need to setup the following credentials as github secrets (similar to the example given): ORGANIZATION - dockerhub organization REPO - dockerhub image repository from the above organization (not sure if a new one needs to be created?) USERNAME and PASSWORD for a user with access to these

You can find more information about the github action here: https://github.com/docker/build-push-action

How has it been tested?

I used a private github repo for testing the secrets setup along side a private dockerhub repository.

There's an issue I encountered, however. This fails though I'm not sure why yet.. I'm not familiar with dotnet but I believe it may be due to invalid credentials setup?

RUN dotnet publish -c Release -o ./out

Results in this during the publish step, when building the image:

... executor failed running [/bin/sh -c dotnet publish -c Release -o ./out]: exit code: 1

Because of (or without the files generated from) the previous error, the following occurs on this step:

COPY --from=build-env /app/api/VoteMonitor.Api/out/ .

Results in this during the publish step, when building the image:

... failed to compute cache key: "/app/api/VoteMonitor.Api/out" not found: not found

mirceachira avatar Oct 25 '20 10:10 mirceachira