StarlingUAS / ProjectStarling

BRL Flight Arena Infrastructure 2.0
Other
16 stars 3 forks source link

Update and streamline github action deployment #103

Closed mhl787156 closed 2 years ago

mhl787156 commented 2 years ago

This PR aims to streamline system builds and deployments through better utilisation of github actions.

The updated github action serves to do the following:

  1. Any successful push (incl. pull requests) to MASTER branch will create a tag and a release. The version will be incremented by detection on the commit message of #patch, #minor or #major. If none is found, by default the patch is incremented. The built container will be pushed to dockerhub with the tag of its release (e.g. v0.1.2) AND the latest tag. The build will cache to and from cache
  2. Any successful push (incl. pull requests) to DEV branch will not create any github tag or release. It will build the containers and push them to dockerhub with only the tag nightly. The build will cache to and from cache-dev.
  3. Any successful push to any other branch will also not create any github tag or release. It will build the containers and push them as 'testing' containers to dockerhub with the tag set to the name of the branch (e.g. pr-testing-branch). The build will cache from cache-dev and will not cache the output. On a pull request close or branch delete, there is also an attempt to delete the testing container from dockerhub.

The github action uses several composite actions to perform the semantic versioning and build. It also uses the strategy matrix to reduce repetition in the action file.

TODO:

Future suggestions: We need to move everything to its own organization, this build script is getting rather unwieldy with all the new AP containers too!

rob-clarke commented 2 years ago

Rather than passing in true/false for the arm64 build, is it possible to run buildx bake --print beforehand and parse the desired platforms?

mhl787156 commented 2 years ago

Rather than passing in true/false for the arm64 build, is it possible to run buildx bake --print beforehand and parse the desired platforms?

Quite possibly? Is that necessary for this pr though? perhaps this can be an improvement to the composite action which deals with it... (https://github.com/mhl787156/starling-bake-build-action)

rob-clarke commented 2 years ago

No probably not. I guess we have to maintain a list of targets for each stage in the workflow file anyway.

rob-clarke commented 2 years ago

I guess we'll see if the dev branch stuff works too