w3c-ccg / vc-ed-models

https://w3c-ccg.github.io/vc-ed-models/
Other
9 stars 5 forks source link

Update github action to include static files #9

Closed kimdhamilton closed 3 years ago

kimdhamilton commented 3 years ago

Initially, I manually ran the following to get the static files in the gh-pages branch:

git checkout main -- samples/
git checkout main -- images/
git checkout main -- contexts/

etc

We need to automate that as part of github actions

jchartrand commented 3 years ago

@kimdhamilton

Do you mean that we should submit a PR on the spec-prod repo (https://github.com/w3c/spec-prod) to have the spec-prod action copy over directories from 'main' and not just the index.html file (as it does now)? Maybe allow the spec-prod action to take a list of such directories (i.e., directories to copy) as an argument?

Or do you mean that we should modify the GitHub action in this repo (https://github.com/w3c-ccg/vc-ed-models/blob/gh-pages/.github/workflows/publish.yml) to copy over the directories?

kimdhamilton commented 3 years ago

(corrected because I misread previously)

this is a good point. I hadn't considered adding this to spec-prod. For now, I was intending to modify the github action in this repo to copy over the directories. We might want to apply that change too in markdown-to-spec since this was created from that template, but starting here would provide a good test case too.

jchartrand commented 3 years ago

Will do - I will start with figuring out how to modify the GitHub action in this repo.

jchartrand commented 3 years ago

@kimdhamilton

I've submitted a PR with the change. The PR is showing a failing check, but I think this is because it is trying to test what is in the action - which includes a push to the gh-pages branch (to update the static files) - and the bot doesn't have permission to make this push (which makes sense because the PR hasn't yet been accepted - you wouldn't want to willy nilly let anyhow submit a PR that triggers all sorts of changes).

In other words, I'm hopeful that if the PR is accepted, the permissions will then allow the action to run properly.

This all makes me wonder though if this action should really be trigged by a pull request? Don't you always want to first confirm the pull request before triggering the action to update gh-pages?

kimdhamilton commented 3 years ago

Fixed by @jchartrand -- thanks!