- Prerequisists
- Setup
Prerequisists
- Docker is needed to be installed because
act
depends ondocker
Setup
Set up act
in Codespaces or Windows or anyother OS
- Start you codespace from GitHub either in directly in VSCode or in the browser
- Double check if
Docker
is installed in your codespaces. - If yes then act-cli need to be installed
- Either use
go
if you have it or install it withbrew
orbash
or any other way explained here
Sample commands to install act-cli
go install github.com/nektos/act@latest
go install github.com/nektos/act@master
After set up
Once act has been installed on your codespace or windows or anyother OS you will need to clone the repository which workflows and actions you want to run.
Example commands
Sample Workflow:
{% highlight yml %}
jobs:
hello_world_job:
runs-on: ubuntu-latest
name: A job to say hello
steps:
# To use this repository’s private action,
# you must check out the repository
- name: Checkout
uses: actions/checkout@v2
- name: Hello world action step
uses: ./ # Uses an action in the root directory
id: hello
with:
who-to-greet: ‘Mona the Octocat’
# Use the output from the hello
step
- name: Get the output time
run: echo “The time was ${{ steps.hello.outputs.time }}”
{% endhighlight %}