Skip to content

Integrate Taskfile with CI/CD

When you want to integrate Taskfile with your CI/CD pipeline, there are multiple ways that you can reference the remote Taskfile.

  • https://raw.githubusercontent.com/<username>/<repo>/<branch>/<path>/Taskfile.yml
  • https://github.com/<username>/<repo>.git//<path>/Taskfile.yml?ref=main
    • //<path> make sure to include the // before the path.
  • git@github.com/<username>/<repo>.git//<path>/Taskfile.yml?ref=main

Step 1: Enable this remote experiment feature

Bash
# Set the environment variable to download the remote taskfile
export TASK_X_REMOTE_TASKFILES=1 

Step 2: Include remote Taskfile or execute from CLI directly

Bash
task --taskfile https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml

OR

Taskfile.yml
version: '3'

includes:
  # without authentication
  app-remote: https://raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml
  # with authentication
  app-remote-auth: https://{{.TOKEN}}@raw.githubusercontent.com/go-task/task/main/website/static/Taskfile.yml
Bash
task app-remote

export TOKEN=<your-token>
task app-remote-auth

Step 3 (Optional): Force download the remote Taskfile

By default, the cache will be stored in the .task directory. But if you want to make sure the remote Taskfile always up-to-date, you can force download it by using the --download flag or you can use --clear-cache to clear all remote cache.

Bash
# Choose one of the following commands that suits your needs
task --download -y # force download the remote Taskfile
task --clear-cache # clear all remote cache