Skip to content
cloud

GitHub Action

Setup Terminus

v1.2.1 Latest version

Setup Terminus

cloud

Setup Terminus

Install and configure the Pantheon CLI tool, Terminus

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup Terminus

uses: pantheon-systems/[email protected]

Learn more about this action in pantheon-systems/terminus-github-actions

Choose a version

Actively Maintained

Terminus GitHub Actions

A GitHub Action for quickly installing and configuring the Pantheon CLI tool, Terminus.

Usage

In order to avoid deprecation warnings, it's recommended to use the setup-php action rather than rely on the version of PHP that is installed by default on GH runners.

steps:
  - name: Setup PHP
    uses: shivammathur/setup-php@v2
    with:
      php-version: "7.4"

  - name: Install Terminus
    uses: pantheon-systems/terminus-github-actions@v1
    with:
      pantheon-machine-token: ${{ secrets.PANTHEON_MACHINE_TOKEN }}

  - name: List sites
    run: terminus site:list

By default, this action installs the latest version of Terminus that has been released on GitHub. You can provide a specific version of Terminus to install using the terminus-version input:

steps:
  - name: Setup PHP
    uses: shivammathur/setup-php@v2
    with:
      php-version: "7.4"

  - name: Install Terminus
    uses: pantheon-systems/terminus-github-actions@v1
    with:
      pantheon-machine-token: ${{ secrets.PANTHEON_MACHINE_TOKEN }}
      terminus-version: 2.6.5

  - name: List sites
    run: terminus site:list

This action will encrypt and cache the Terminus session by default to be re-used across jobs in a workflow to reduce the number of authorizations. If you need to disable this for some reason, you can set the disable-cache option to true.

steps:
  - name: Install Terminus
    uses: pantheon-systems/terminus-github-actions@v1
    with:
      pantheon-machine-token: ${{ secrets.PANTHEON_MACHINE_TOKEN }}
      disable-cache: true

Please note that in order to run commands that require SSH (e.g. drush or wp-cli), you will need to setup a SSH key. There are plenty of options available in the Github Actions Marketplace. We recommend you to choose one of them and use them in your pipeline.

Credits

Big thanks to Gareth Jones and Ackama for the initial development work.