chore: set up SFTP deployment workflow to Pantheon #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Pantheon (SFTP) | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
if: ${{ vars.DEPLOY_TO_PANTHEON_SFTP }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install npm dependencies | |
run: npm ci | |
- name: Install PHP dependencies with Composer | |
uses: php-actions/composer@v6 | |
with: | |
php_version: '8.1' | |
version: 2.x | |
- name: Build theme | |
run: npm run build:prod | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.PANTHEON_ID_RSA }} | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- name: Add SSH Key | |
run: | | |
eval `ssh-agent` | |
ssh-add ~/.ssh/id_rsa | |
- name: Install Terminus | |
uses: pantheon-systems/[email protected] | |
with: | |
pantheon-machine-token: ${{ secrets.PANTHEON_ID_RSA }} | |
- name: List sites | |
run: terminus site:list |