covid19-dash / covid-dashboard

Help welcomed if you have expertise in public health web technology, data modeling and munging, or visualization.
https://covid19-dash.github.io/
BSD 3-Clause "New" or "Revised" License
131 stars 41 forks source link

Automate deployment to GH pages #5

Closed emmanuelle closed 4 years ago

emmanuelle commented 4 years ago

Add Github action to deploy to github pages.

Needs to use the Makefile to transform dash app pages into a static site.

glemaitre commented 4 years ago

I would be happy to give a hand on this one.

GaelVaroquaux commented 4 years ago

Thanks a lot! Do you need access to the repo?

glemaitre commented 4 years ago

I think so.

GaelVaroquaux commented 4 years ago

OK, I'm on it.

emmanuelle commented 4 years ago

Thank you @glemaitre :-). The current workflow is in the Makefile, it consists of

glemaitre commented 4 years ago

So the deployment should happen at each merge of a PR in master?

emmanuelle commented 4 years ago

yes. Soon enough we will switch to a pull-request mode so we'll be able to check that the changes should not break the deployment.

GaelVaroquaux commented 4 years ago

@glemaitre : did you get the invitation for the repo?

emmanuelle commented 4 years ago

Please note that https://github.com/covid19-dash/covid-dashboard/commit/b2ce5a9ae32b7f2386d4bd10f2ecad4ae48459b2 added one line to the Makefile.

glemaitre commented 4 years ago

Yes. I am trying to deploy on my fork before to make a PR here. I am the config of the token for automatic push so it should be soonish working.

GaelVaroquaux commented 4 years ago

Exciting!!

If it's easier for you, do not hesitate to push to master. We are still at early stages of the project.

glemaitre commented 4 years ago

So it should normally push in gh-pages now.

In short, I made a make html and push the content of the localhost to gh-pages when there is a push on master. We should check that we have the right content.

If something else need to be configure, I relied on the following github-action: https://github.com/peaceiris/actions-gh-pages

glemaitre commented 4 years ago

I assume that when we are happy with the current results we can push to the repository of the website. This should not be a big deal. We need to setup to wish repository to push: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-deploy-to-external-repository

emmanuelle commented 4 years ago

Thanks a lot ! I'll try it out when the little one is asleep :-). Good night ;-)

glemaitre commented 4 years ago

OK, one thing strange (which is the reason I did not push in the website repo yet), I am getting a Loading...: https://covid19-dash.github.io/covid-dashboard/

But I think it should be due to the state of master rather than something weird on the deployment.

glemaitre commented 4 years ago

FYI:

We need to change the deploy section with:

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          deploy_key: ${{ secrets.DEPLOY_KEY }}
          external_repository:  covid19-dash/covid19-dash.github.io
          publish_branch: master
          publish_dir: ./127.0.0.1:8050
glemaitre commented 4 years ago

I set up the SSH keys so only the section needs to be changed. Feel free to change it during my sleep :)

emmanuelle commented 4 years ago

Hum this "Loading" thing can be due to Jekyll, I'll check whether the GH action pushes a .nojekyll file.

GaelVaroquaux commented 4 years ago

I think that the reason that this is not working is that the scripts and other components are referred too with a "/..." href.

If we deployed to the .github.io repo instead of the gh-pages of this repo, I think that it would work.

GaelVaroquaux commented 4 years ago

OK, this worked: the github action now works. Thank you very much @glemaitre !!