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.
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.