GitHub Actions
You can run a Jyfti workflow on GitHub Actions. This way, it is possible to run a workflow on a schedule or as a reaction to GitHub events. The advantage of using Jyfti on GitHub Actions instead of plain GitHub Actions is that you gain the ability to run a workflow both locally as well as remotely. It is even possible to retrieve the state of a Jyfti workflow from GitHub Actions and to locally debug it.
A pure Jyfti workflow on GitHub Actions typically consists of five steps:
- Checking out the repo
- Setting up node
- Installing the Jyfti CLI
- Running the workflow
- Storing the Jyfti state artifact
Secrets
For many you might want to pass secrets from the environment to the Jyfti workflow such that Jyfti can execute authenticated HTTP requests. Assuming that you have a GitHub environment holding your secrets, you can pass each field of a Jyfti environment as environment variable.
It is possible to pass nested fields like --env-var github.token=GITHUB_TOKEN
.
If there exists an environment file, then the passed environment variables overwrite the specific values of that file.
Local execution
If a Jyfti workflow has failed, you can inspect and re-execute it locally from the point where it failed.
You can use the github-artifact
workflow to copy the remote workflow state into your local state directory.
Then, you can proceed with the now local workflow state.
Note that this only copies the workflow state and not the workflow itself. It is recommended to store the workflows in git.
If your CI environment passes environment variables to the Jyfti workflow, then you can either pass the environment variables locally as well or store them in your local environment file.
Only save failures
If a Jyfti workflow succeeds, you might not be interested in the workflow state and therefore don't store it. You can do so via an if-condition in the GitHub Actions workflow.