A Github Action for quickly installing and configuring the Pantheon CLI tool, Terminus.
- Pantheon Account + Site
- Pantheon Machine Token
Using this action requires first setting up PHP in the workflow. Huge thanks to @shivammathur for all that legwork creating setup-php
.
Please note that the PHP setup action is required before running Terminus setup.
pantheon-machine-token
(required): This action will not be able to authenticate to panthon unless you pass in your Pantheon Machine Token.
terminus-version
(optional): Due to your project build environment, you may need to remain on an older version of terminus. If so, you can use this variable to do so. Any version format supported by terminus's installer.phar will work. Here is an example:
- name: Installing Terminus
uses: chromatichq/setup-pantheon-terminus@master
with:
pantheon-machine-token: YOUR_TOKEN
terminus-version: 2.6.1
The following is a Github Workflow example which will install PHP and Terminus, then output the sites on Pantheon for that account.
name: Setup Terminus
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Installing PHP
uses: shivammathur/setup-php@master
with:
php-version: '7.3'
- name: Installing Terminus
uses: kopepasah/setup-pantheon-terminus@master
with:
pantheon-machine-token: ${{ secrets.PANTHEON_MACHINE_TOKEN }}
- name: Listing Sites
if: success()
run: terminus site:list
In the above example, PANTHEON_MACHINE_TOKEN
is an encrypted secret added to the repo on Github, of which the value is the Machine Token generated by Pantheon.
Yes, the node_modules
directory was commited to this repo on purpose. Github actions requires these modules in order to run and I chose to include the Node modules in lieu of bundling all the modules into one file.