Skip to content

Commit

Permalink
Merge pull request #12 from nektos/update-docs
Browse files Browse the repository at this point in the history
migrate "Using local runner images" docs
  • Loading branch information
cplee authored Feb 6, 2024
2 parents 9b32fca + 7787c44 commit 3eab371
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Necessary prerequisites for running `act`

`act` depends on `docker` (exactly Docker Engine API) to run workflows.
`act` depends on `docker` (exactly Docker Engine API) to run workflows in containers. As long you don't require container isolation, you can run selected (e.g. windows or macOS) jobs directly on your System see [Runners](../usage/runners.md). In the latter case you don't need to have docker installed or running.

If you are using macOS, please be sure to follow the steps outlined in [Docker Docs for how to install Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/install/).

Expand Down
20 changes: 20 additions & 0 deletions src/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,23 @@ This will trigger the workflow to use the following matrix configurations only:
- `os: macos-latest, node 10`

Note that using the `--matrix` flag you can't add new values (for e.g. running the above workflow for node 20). It will simply ignore it. Moreover, the `exclude` field in the workflow will take precedance over the `--matrix` flag (for e.g. running the above workflow for only macos-latest and node 4 will result in no matrix configuration being used)

## Action Offline Mode

If you want to speed up running act and using cached actions and container images you can enable this mode.

- stops pulling existing images
- stops failing if an action has been cached and you cannot connect to GitHub
- pulls non existent actions and images
- act will work offline if it has at least ran once while you are online
- get rid of unnecessary timeouts when you have an unstable connection to GitHub or Container registries
- workaround rate limit problems

```sh
act --action-offline-mode
```

or a `.actrc` file in your cwd like
```
--action-offline-mode
```
17 changes: 16 additions & 1 deletion src/usage/runners.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If you need an environment that works just like the corresponding GitHub runner

- [`catthehacker/ubuntu:full-*`](https://github.com/catthehacker/docker_images/pkgs/container/ubuntu) - filesystem dump of the Runners provided by GitHub, see [`ChristopherHX/runner-image-blobs`](https://github.com/ChristopherHX/runner-image-blobs) or [`catthehacker/docker_images`](https://github.com/catthehacker/docker_images) for more information

## Use an alternative runner image
### Use an alternative runner image

To use a different image for the runner, use the `-P` option.

Expand All @@ -59,3 +59,18 @@ For example, if your workflow uses `ubuntu-18.04`, `ubuntu-16.04` and `ubuntu-la
```sh
act -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 -P ubuntu-latest=ubuntu:latest -P ubuntu-16.04=node:16-buster-slim
```

### Using local runner images

The `--pull` flag is set to true by default due to a breaking on older default docker images. This would pull the docker image everytime act is executed.

Set `--pull` to false if a local docker image is needed
```sh
act --pull=false
```

Alternatively turn on offline mode

```sh
act --action-offline-mode
```

0 comments on commit 3eab371

Please sign in to comment.