openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
821 stars 252 forks source link

Add update docs action #1633

Closed Confectrician closed 2 years ago

Confectrician commented 2 years ago

This will add an action, which triggers an openhab docs repo action on an openHABian release. (Or on a manual dispatch of this action via the Github Page.)

Depends on: openhab/openhab-docs#1690

Goal

Transfer latest openHABian documentation to the openhab docs website, when a new release has been published.

Prerequisites

Workflow

This action will trigger a repository_dispatch event in the openhab-docs repository, when everything is set up correct. This event will start an action in the openhab-docs repository that fetches the latest openHABian docs contents and copy them into the stable-release openHAB documentation.

@kaikreuzer can we steup a Personal Access Token with the openhab-bot account for this? The PAT then needs to be stored as a Secret in this repo, with the name written above. This is needed to trigger events across different repositories.

ecdye commented 2 years ago

@Confectrician why not just do it every time the docs are updated in this repo. It is pretty simple to accomplish by doing something like:

on:
  push:
    paths:
      - 'docs/**'

Unless of course you are concerned about the workflow being triggered too often causing too many refresh's for our build system to handle.

Confectrician commented 2 years ago

Hey @ecdye

This was the procedure, I had a talk about with @mstormi before starting working on this.

Please note that we are talking about the docs "stable version". Any changes in the meantime will get copied into the snapshot docs trough our regularly Jenkins ci job parallel.

Edit:

So now that i am not on my phone but on a real keyboard:

Build time is also a foctor that may get important at some point. I have implemented those actions now in a reausable way and want to add some more repos like alexa, google-assistant, vscode and others where this makes sense.

Even with the open source plan of netlify (which hosts our website and docs) we have som limit for the build minutes and we already got warnings in the past, especially when we are near to an openHAB release where many builds are triggered from the openHAB Distro.

We can extend the amount of events at any point, but i think per release is a good point for startign with this.

ecdye commented 2 years ago

Fair enough, I was just curious about the reasoning behind the decision. Perhaps in the future it would be better for a transparency of communication to use the GitHub Team discussions page so that all the maintainers can see and comment.

Confectrician commented 2 years ago

You are totally right. I have to excuse me for this.

But for completeness i have to admit that we started this talk personal on the general assembly event of the openhab foundation somw weeks ago and i just continued on that base within a community message. So there was no bad intention on this.

ecdye commented 2 years ago

No, problem. To be honest this is a great idea and should be very useful once fully implemented.

Confectrician commented 2 years ago

OK, we are ready. Token has been placed and the actions on docs repo side are available.

Confectrician commented 2 years ago

I did a test run from openhab-docs repo side and the created PR looks valid. https://github.com/openhab/openhab-docs/pull/1694

Confectrician commented 2 years ago

Yes we are.

We should verify if the trigger is working correct after merging by running the action manually. You should be able to do so in the actions tab after merging.

Confectrician commented 2 years ago

Worked like a charm. Thanks. :)

https://github.com/openhab/openhab-docs/pull/1697