Skip to content

Commit 5dab792

Browse files
authoredFeb 29, 2024··
Merge pull request #426 from OpenFn/gh_dashboard
Update Link to GH with steps from Portability, new dashboard page
2 parents 94bd778 + 295ee1c commit 5dab792

File tree

5 files changed

+105
-27
lines changed

5 files changed

+105
-27
lines changed
 

‎docs/manage-projects/link-to-gh.md

+79-27
Original file line numberDiff line numberDiff line change
@@ -36,41 +36,93 @@ Click `Configure`...
3636
5. You'll be redirected to OpenFn. Select the repository and branch you want to
3737
sync to, and click `Connect Branch`.
3838

39-
6. Your GitHub connection is now set up!
40-
41-
7. Synchronization is _not_ automatic. Each time you want to sync between your
42-
project and GitHub, click `Initiate Sync to Branch`.
43-
44-
![Initiate Sync](/img/lightning_gh_initate_sync.png)
45-
46-
:::tip Sync after every major change
47-
48-
Each time you make any significant change in your project, for example changes
49-
in a job code, make sure to hit `Initiate Sync to Branch` to sync your updates
50-
to GitHub.
51-
52-
:::
39+
6. Once you have created a a connection, set up `pull` and `deploy` workflows
40+
that use openfn github actions below.
41+
7. Add `OPENFN_API_KEY` and `OPENFN_PROJECT_ID` repository secrets to your
42+
Github repo as described below.
43+
8. Add a `config.json` file to your repository which specifies your endpoint and
44+
paths to project spec and state files.
45+
9. Click the sync to Github button to initiate a sync from Lightning to GitHub.
46+
10. Push a change to your selected branch to push changes from Github to
47+
Lightning.
48+
49+
#### Github Repository Secrets
50+
51+
The workflows that interact with the OpenFn actions will need the repository set
52+
up with two secrets used in the github actions:
53+
54+
- OPENFN_API_KEY: This is your API Key as generated from Lightning and will be
55+
needed for authentication
56+
- OPENFN_PROJECT_ID: This is your Project ID from Lightning this will be used to
57+
pull from the lightning instance
58+
59+
#### Github Repository Structure
60+
61+
Here you can do pretty much what you want, so long as you've got a `config.json`
62+
pointing to your project spec, state, and Lightning endpoint.
63+
64+
#### Example [Deploy Workflow](https://github.com/OpenFn/demo-openhie/blob/main/.github/workflows/deploy.yml) for GitHub
65+
66+
See https://docs.github.com/en/actions/quickstart#creating-your-first-workflow
67+
for more help here.
68+
69+
```yml
70+
on:
71+
push:
72+
branches:
73+
- main
74+
75+
jobs:
76+
deploy-to-lightning:
77+
runs-on: ubuntu-latest
78+
name: A job to deploy to Lightning
79+
steps:
80+
- name: openfn deploy
81+
uses: OpenFn/cli-deploy-action@v0.1.11
82+
with:
83+
secret_input: ${{ secrets.OPENFN_API_KEY }}
84+
```
85+
86+
#### Example [Pull Workflow](https://github.com/OpenFn/demo-openhie/blob/main/.github/workflows/pull.yml) for GitHub
87+
88+
See https://docs.github.com/en/actions/quickstart#creating-your-first-workflow
89+
for more help here.
90+
91+
```yml
92+
on: [repository_dispatch]
93+
94+
jobs:
95+
pull-from-lightning:
96+
runs-on: ubuntu-latest
97+
permissions:
98+
contents: write
99+
name: A job to pull changes from Lightning
100+
steps:
101+
- name: openfn pull and commit
102+
uses: OpenFn/cli-pull-action@v0.7.0
103+
with:
104+
secret_input: ${{ secrets.OPENFN_API_KEY }}
105+
project_id_input: ${{ secrets.OPENFN_PROJECT_ID }}
106+
commit_message_input:
107+
'user ${{ github.event.client_payload.message }}'
108+
```
109+
110+
The Lightning [demo instance](https://demo.openfn.org) is currently connected to
111+
[this repo](https://github.com/OpenFn/demo-openhie/). Feel free to play around
112+
with it.
113+
114+
11. Your GitHub connection is now set up! From here, each time you want to sync
115+
between your project and GitHub, click `Initiate Sycn to Branch`.
53116

54117
### How It Works in a Nutshell
55118

56-
Your whole OpenFn project can be represented as a `project.yaml` file. It
57-
includes all your workflow specifications, their name, job code, triggers, and
58-
so on.
119+
Your whole OpenFn project can be represented as a project.yaml file.
59120

60121
Using our Command Line Interface, the [@openfn/cli](../deploy/portability.md)
61122
you can pull a project config from OpenFn to a folder or repo on your computer,
62-
and you can deploy a change in your `project.yaml` file from that directory or
123+
and you can deploy a change in your project.yaml file from that directory or
63124
repo to OpenFn.
64125

65-
:::info
66-
67-
As your `project.yaml` file represents your entire project, this is the file
68-
that you have to update when you want to deploy any changes to your OpenFn
69-
project. If you made a change or created a new job, for example, you have to
70-
include them in the `project.yaml` to deploy.
71-
72-
:::
73-
74126
The `Sync to Github` feature makes use of GitHub actions to automatically deploy
75127
(after a commit) or pull (when `Initiate Sync to Branch` button is clicked) to
76128
keep a repository in sync with your OpenFn project.
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Monitoring Workflows
3+
sidebar_label: Monitoring Workflows
4+
slug: /monitoring-workflows
5+
---
6+
7+
In this article, you'll learn how you can monitor the status of your Workflows.
8+
9+
## Workflow Dashboard
10+
11+
On your main Workflows page you can get an overview of the number of the Work
12+
Orders and Runs in your project, and the number and ratio of successes and
13+
failures.
14+
15+
![Dashboard](/img/lightning_workflow_dashboard.png)
16+
17+
For further investigation, clicking on the number of Work Orders for the
18+
Workflows as shown bring you to the History of that Workflow. For example, here
19+
are the 7 Work Orders in a failed state:
20+
21+
![Failed Work Orders](/img/lightning_failed_work_orders.png)
22+
23+
Check out our
24+
[History docs](https://docs.openfn.org/documentation/monitor-history/activity-history)
25+
for more on managing and monitoring Runs and Work Orders.

‎sidebars-main.js

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ module.exports = {
111111
'manage-projects/notifications',
112112
'manage-projects/link-to-gh',
113113
'manage-projects/webhook-auth',
114+
'manage-projects/workflow-dashboard',
114115
],
115116
},
116117
{
97.4 KB
Loading
102 KB
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.