Skip to content

Commit

Permalink
Workflow through CLI
Browse files Browse the repository at this point in the history
Workflow through CLI

sections

link

link

link

link

link
  • Loading branch information
neelasha23 committed Jan 16, 2024
1 parent 4788b96 commit f8f22a9
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion doc/user-guide/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

You can use GitHub Actions to deploy your project on each push.

## Set Github secret

First, you need to get your [API key](../quickstart/apikey.md). Once you have the API
key, you need to store it as a GitHub secret in your repository:

Expand All @@ -10,6 +12,8 @@ key, you need to store it as a GitHub secret in your repository:
![](../static/github/set-secret.png)


## Initialize project

Then, install the CLI:

```sh
Expand All @@ -31,6 +35,9 @@ ploomber-cloud init

`init` will create a `ploomber-cloud.json` file. For more information on the `init` command, see [](../user-guide/cli.md)

(monitor)=
## Configure and monitor Github actions

Now, configure GitHub actions by adding [this YAML file](https://github.com/edublancas/cloud-template/blob/main/.github/workflows/ploomber-cloud.yaml) in `.github/workflows/ploomber-cloud.yaml`

Finally, commit and push the new files:
Expand Down Expand Up @@ -69,4 +76,28 @@ Without `--watch`, the logs will look like this:

![](../static/github/logs.png)

A complete sample project is [available here.](https://github.com/edublancas/cloud-template)
A complete sample project is [available here.](https://github.com/edublancas/cloud-template)

## Configure action through CLI

If your project is already hosted on Github, running `ploomber-cloud init` inside your repository folder will initialize
the project and prompt for configuring Github action:

```bash
Your app 'snowy-disk-4284' has been configured successfully!
Do you want to configure a github action? [y/N]:
```

On confirming with `y` the CLI will create a `ploomber-cloud.yaml` file in the path `.github/workflows`.
In order to trigger an action for deploying the project using Github actions you need to add, commit and push this file along with the `ploomber-cloud.json`.

Once done, you can monitor progress as discussed [above](monitor). Ensure that the API key is set as Github secret.

In case the [workflow template](https://github.com/edublancas/cloud-template/blob/main/.github/workflows/ploomber-cloud.yaml) has been updated, and you need to re-initialise the application the CLI will prompt your for updating the workflow file:

```bash
Your app 'red-river-8187' has been configured successfully!
.github/workflows/ploomber-cloud.yaml seems outdated. Do you want to configure a github action? [y/N]:
```

Please review the workflow file and update if needed.

0 comments on commit f8f22a9

Please sign in to comment.