This repository has been archived by the owner on Feb 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
52 lines (48 loc) · 1.74 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: 'Install Pantheon Terminus'
description: "Install Terminus, Pantheon's CLI tool."
inputs:
terminus-version:
description: 'A specific version of Terminus to install. (x.y.z)'
default: '3.0.7'
required: false
type: string
pantheon-machine-token:
description: 'A machine token for Terminus generated by Pantheon.'
required: true
type: string
setup-ssh:
description: 'Determine whether or not to setup an SSH key with Pantheon.'
required: false
default: false
type: boolean
pantheon-ssh-key:
description: 'An SSH key to setup on Pantheon.'
required: false
type: string
runs:
using: "composite"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Download and install Terminus
run: |
echo "Installing Terminus version: ${{ inputs.terminus-version }}"
mkdir -p ~/terminus && cd ~/terminus
curl -L https://github.com/pantheon-systems/terminus/releases/download/"${{ inputs.terminus-version }}"/terminus.phar --output terminus
chmod +x terminus
sudo ln -s ~/terminus/terminus /usr/local/bin/terminus
shell: bash
- name: Authenticate with Pantheon machine token
run: terminus auth:login --machine-token="${{ inputs.pantheon-machine-token }}"
shell: bash
- name: Setup SSH
if: ${{ inputs.setup-ssh == 'true' }}
run: |
echo "Setting up SSH key"
mkdir ${HOME}/.ssh && chmod 700 ${HOME}/.ssh
echo -e "Host *.drush.in\n StrictHostKeyChecking no\n HostkeyAlgorithms +ssh-rsa" > ${HOME}/.ssh/config
echo "${{ inputs.pantheon-ssh-key }}" > ${HOME}/.ssh/id_rsa
chmod 600 ${HOME}/.ssh/*
shell: bash