Cli-microsoft365: New feature: GitHub actions for Office 365 cli

Created on 5 Sep 2019  路  10Comments  路  Source: pnp/cli-microsoft365

Can we think of introducing GitHub actions for office365-cli? I had a look at the actions available for azure cli so we can do something on similar lines. If ok, then we can think of the following maybe?

  • an action for login
  • an action for running an office 365 cli command
  • (in future) an action to deploy an spfx package to the app catalog
new feature work in progress

Most helpful comment

Just to chip in. If we are looking at potentially using a Docker Container for this purpose, there is a potential to re-use the same image to allow us to use Remote Development in VS Code for the CLI, this would help provide a consistent cross platform development environment for project contributors to use. Something we may want to consider...

All 10 comments

Do you have an idea for a specific scenario/problem they would solve?

I was thinking mainly for adding SPFx package to app catalog, like we do in Azure pipelines using office 365 cli currently. E.g. In a DEV tenant, when the code is pushed to a GitHub repo, create the package and add it the app catalog. Something along these lines?

It sounds interesting indeed. Looking at the Actions' docs shows:

GitHub Actions is currently in limited public beta and is subject to change. We strongly recommend that you do not use this feature for high-value workflows and content during the beta pe

Do you think it would be worth investing in this already or would it be better for actions to stabilize and revisit it then?

Yes @waldekmastykarz let's revisit this later.

So @waldekmastykarz what I was thinking was we create a GitHub action named something on the lines of "Add and deploy SPFx package using Office 365 CLI". This action would do the following:

  1. Login to the tenant
  2. Add the app to the app catalog site
  3. Deploy the app

To create the action, after reading this article, I was thinking if we start with the aptly named "Hello word docker action".

The idea would be to use a docker container which has Office 365 CLI installed in it and we run the above 3 commands. You have written posts on docker with SPFx before, so if you like this approach can you please let us know if there is a docker container with Office 365 CLI that we can make use of?

There is no docker image with the CLI yet, but the article you mentioned, talks about creating an image specifically for the action, so for now we could take the regular Node.js image as a baseline and include installing the CLI as one of the steps in the dockerfile. Once we get a docker image with the CLI in it, we could update the dockerfile to point to the CLI image instead. Does that make sense?

Just to chip in. If we are looking at potentially using a Docker Container for this purpose, there is a potential to re-use the same image to allow us to use Remote Development in VS Code for the CLI, this would help provide a consistent cross platform development environment for project contributors to use. Something we may want to consider...

I've been thinking about publishing a docker image for the CLI in the past but was stuck in how to tie it in into our release process. Ideally, I'd have the image use the latest version of the CLI but I'm not sure if publishing the CLI to npm and trying to use the just released version of the CLI from an image would work in the same release.

For now I will submit a PR with a docker container from Node.js and install Office 365 CLI. We can change it to the required one easily in the future.

As we now have multiple Actions published to GitHub marketplace and issues/PRs will be handled within their respective repositories, I will close this issue as the work is now complete.

Thank you for your initial suggestion and your efforts @anoopt 馃憦馃徎

Was this page helpful?
0 / 5 - 0 ratings