> ## Documentation Index
> Fetch the complete documentation index at: https://demoman.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Keep videos current

> One command sets up GitHub Actions to record the repo's flows again and deliver what changed.

<ol />

With flows in the repo, CI records them again on a trigger you choose and
delivers only the videos whose picture changed.

## Before you start

* The repo is on github.com, and `gh` is installed and signed in.
* At least one flow is added ([Add to your repo](https://demoman.io/docs/get-started/add-to-repo.md)).
* Apps behind a login use demo accounts ([Sign in](https://demoman.io/docs/get-started/sign-in.md)).

## Set it up

```bash theme={null}
npx demoman setup --ci
```

Setup records your flows once from a clean checkout, then shows one plan and
asks once. Nothing is written to your checkout or to GitHub before you
confirm. The plan names:

| Part | Choices |
| - | - |
| Trigger (`--trigger`) | After a successful deployment, when a release is published, `daily`, `push` (each merge), or `manual` (only when you run it from the Actions tab) |
| Route (`--route`) | `pr`: open a pull request with the changed videos (the default). `main`: commit them to the branch |
| Files | `.github/workflows/demoman.yml`, `.demoman/app.json`, and any flow not yet on the default branch |
| Secrets | Each demo account's secret, by name only |

The Studio offers the same plan after an add, in its Add to repo sheet:

![The Add to repo sheet after an add: the four files it wrote, then the CI plan with its trigger, route and Open pull request](https://mintcdn.com/demoman/cf_9vqS3zSprr--g/media/studio/add-to-repo-ci.png?fit=max\&auto=format\&n=cf_9vqS3zSprr--g\&q=85\&s=75d9fd24889558500bc494f18f6cae68)

On your confirmation it sets the secrets, opens a pull request titled "Set up
Demoman", and watches its first run until it passes or fails.

## How CI starts your app

`.demoman/app.json` is the committed record of how the app installs and
starts, and where it answers. Setup drafts it from your repo (a Playwright
`webServer`, a CI workflow, `package.json`) and asks for anything it cannot
find. Every field, and pinning the date for an app that shows today's date,
is on [app.json](https://demoman.io/docs/reference/app-json.md).

## After setup

On each trigger, the workflow runs `demoman refresh`. With the `pr` route it
opens or updates one pull request, "Refresh demo videos", listing each
changed video. Merge it to publish them. When nothing changed, nothing is
committed. [Refresh](https://demoman.io/docs/concepts/refresh.md) explains how a change is judged.

The workflow runs the Demoman release that wrote it. To move it to a newer
one, run `npx demoman setup --ci` again: it opens one pull request, "Update
Demoman's workflow", that keeps the trigger and route you chose.

> [!NOTE]
>
> The `pr` route needs **Allow GitHub Actions to create and approve pull
> requests** under Settings → Actions → General. Setup turns it on for you;
> in an organisation that forbids it, an owner allows it there first.

If setup stops, it says why and what to do; every reason is on
[Refusals](https://demoman.io/docs/reference/refusals.md#setting-up-ci). All flags are on
[setup](https://demoman.io/docs/reference/setup.md).

> [card] [Next · Concepts](https://demoman.io/docs/concepts/refresh.md)
>
> How a refresh decides what changed


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.