Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to gh-actions / deploy updatesite to different folders in gh-pages #436

Open
laeubi opened this issue Jul 15, 2021 · 15 comments
Open
Assignees

Comments

@laeubi
Copy link
Contributor

laeubi commented Jul 15, 2021

We are currently using Travis CI, but the goal would be to migrate this to gtihub actions.

As part of this migration, the deployment should be changed so that different branches are deployed to different folders (instead of different gh-pages) so we can have a better user-experience.

The structure should be as follows:

  • rootfolder (contains some arbitratry files)
  • branchA
  • branchB
  • branchC

where each branch is a different build.

@laeubi
Copy link
Contributor Author

laeubi commented Jul 15, 2021

I have created a basic action now: https://github.com/cucumber/cucumber-eclipse/actions

I think the first steps would be:

  • only one branch/action should be run/build concurrently
  • the following branches should be build sucessfull: v0.x, 1.x, main

@laeubi
Copy link
Contributor Author

laeubi commented Jul 15, 2021

@mattwynne I have tried to setup multiple branches in https://github.com/cucumber/cucumber-eclipse/blob/main/.github/workflows/maven.yml is this the right way or should I place a maven.yml in each branch that should be build?

@laeubi
Copy link
Contributor Author

laeubi commented Jul 15, 2021

@qvdk FYI, another action required would be to disable the travis-ci jobs for this, is this simply deleting the .travis.yml file?

@laeubi laeubi self-assigned this Jul 15, 2021
@qvdk
Copy link
Member

qvdk commented Jul 15, 2021

Yes I confirm

@mattwynne
Copy link
Member

is this the right way or should I place a maven.yml in each branch that should be build?

As I understand it, if you have a workflow like this in your main branch, it will run the workflow if you push to any of the branches listed in the on.push.branches array.

@laeubi
Copy link
Contributor Author

laeubi commented Aug 5, 2021

@mattwynne I have created:

  1. A folder for branch https://github.com/cucumber/cucumber-eclipse/tree/gh-pages/update-site/v1.x
  2. a Workflow for the 1.x branch: https://github.com/cucumber/cucumber-eclipse/blob/1.x/.github/workflows/maven.yml
  3. The workflow produces an update-site under cucumber.eclipse.p2updatesite/target/repository/ that should be placed in the gh-pages directory

can you give a hint how this is bet archived, given that only that folder must always be updated by the workflow?

I think manually it would be something like the following steps:

  1. git clone gh-pages
  2. git rm update-site/v1.x
  3. cp cucumber.eclipse.p2updatesite/target/repository/ update-site/v1.x
  4. git add update-site/v1.x
  5. git commit
  6. git push

but maybe there are smarter ways than doing everything step by step with shell commands?

@mattwynne
Copy link
Member

@laeubi do you mean that, once the mvn -B command has run, there's a directory cucumber.eclipse.p2updatesite/target/repository/ that you want copied to the right folder in the gh-pages branch?

If so, we're on the right lines. I think you need an action something like this:

- run: |
    cp -R cucumber.eclipse.p2updatesite/target/repository/ {{ runner.temp }}/output
    git checkout gh-pages
    rm -rf update-site/{{ github.ref }}
    cp -R {{ runner.temp }}/output update-site/{{ github.ref }}
    git add --update .
    git config --global user.email "[email protected]"
    git config --global user.name "GitHub Actions"
    git commit -m "Add latest update-site for version {{ github.ref }}"
    git push

Can you give that a try?

@mattwynne
Copy link
Member

You might need to change the - uses: actions/checkout@v2 step to make sure you've pulled down the gh-actions branch as well as the current branch. Or maybe you just need a git fetch before the git checkout gh-pages line.

@laeubi
Copy link
Contributor Author

laeubi commented Sep 14, 2021

@mattwynne thanks, thats correct the directory contains the data of the update-site. I'll give it a try.

@laeubi
Copy link
Contributor Author

laeubi commented Sep 14, 2021

@mattwynne I have updated the code but it seems the add does not work and complains about nothing was added. Can you take a look if I'm missing something?

I have just modfied your aproach a bit by checkout both branches in different directories, and currently do not delete any old data.

@laeubi
Copy link
Contributor Author

laeubi commented Sep 14, 2021

I think I found the issue, I simply removed the --update flag from the git add as it seems to only work if there is already a versioned file with this name (and new files are thus never added..)

@laeubi
Copy link
Contributor Author

laeubi commented Sep 14, 2021

@laeubi
Copy link
Contributor Author

laeubi commented Sep 14, 2021

The new update-site hosting containing all versions will be https://cucumber.github.io/cucumber-eclipse/update-site/

Currently there are

that looks a bit nicer, @qvdk @mattwynne can anyone help migrating the more modern design to the https://cucumber.github.io/cucumber-eclipse/update-site/ ?

If that's done we should remove the content from the other sites and place a link to the new site there.

@laeubi
Copy link
Contributor Author

laeubi commented Sep 14, 2021

This is how the update-site currently looks like:
grafik

@laeubi
Copy link
Contributor Author

laeubi commented Sep 14, 2021

The current main branch is deployed now to https://github.com/cucumber/cucumber-eclipse/tree/gh-pages/update-site/main and available as https://cucumber.github.io/cucumber-eclipse/update-site/main/ for usage inside eclipse.

The main is not included in the composite, so users will need to add this explicitly if desired as an extra update-site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants