mmornati / docker-ghostblog

Ghost Blog Docker Container
MIT License
10 stars 6 forks source link

Update and rename .github/workflows/dockerimage.yml to dockerimage.yml #53

Closed mmornati closed 5 years ago

pascalandy commented 5 years ago

Cool stuff Marco! Is this part of the Github Action beta?

sr229 commented 5 years ago

Cool stuff Marco! Is this part of the Github Action beta?

Yep, GitHub Actions has a new YAML sytax to keep up with their new CIs.

sr229 commented 5 years ago

@mmornati You might need to fix your GPG keys first before I merge this

mmornati commented 5 years ago

Yes sorry for the GPG. I changed my personal laptop and I didn't take time to complete the first setup. I just wanted to test the CI :) And it is not complete yet. I need to complete the image_name part as the env variable was not working. And then add the push to Docker Hub. All other stuff seems working like on Travis... Even if the performances are not the same (it is 2 times slower than Travis ci)

mmornati commented 5 years ago

Looks like a empty variable problem in the GitHub CI. Fix that first.

Yes. I sent an email to GitHub yesterday evening. They answered that it should work with this script and the env variables should be visible in all the steps. But actually is not. I will check it later. I put the answer into this PR just to share it with anybody:

The way you defined the variable environment should work for the whole step, and the subsequent runs within this step should be able to access this environment variable. Please try retrieving the variable with ${IMAGE_NAME} and let us know if this is working better for you. You can also use some of the default environment variables if they are used to build the image name.

sr229 commented 5 years ago

Yeah I think we should give GitHub support another hit since our environment variables in this config is not reading properly.

pascalandy commented 5 years ago

I have a similar challenge regarding VARs. Here is the issue.

pascalandy commented 5 years ago

@mmornati here is the solution I found — https://github.com/actions/starter-workflows/issues/68#issuecomment-524937002

mmornati commented 5 years ago

Just for your information @pascalandy and @sr229 I received this week a new mail from the GitHub support. It seems they created stuffs right now to correctly fix the problem. ❤️

There are a couple of ways to share environment variables between steps in a job:

I thought the best one was the ::set-env: quick way to share env variable. And it is working finally !! 😄

mmornati commented 5 years ago

Do not merge for the moment as I would like to add the docker image pushes when a PR is merged (like the check we had in travis)

mmornati commented 5 years ago

It should be good... but a part of the workflow can be really tested only after the merge. I will push it and fix if needed.