Merge pull request #6 from digitalpolygon/doylejd-patch-2 #15
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: Build and Deploy to Pantheon | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
defaults: | |
run: | |
shell: bash | |
env: | |
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }} | |
CI_BRANCH: ${{ github.head_ref || github.ref_name }} | |
BASE_BRANCH: ${{ github.base_ref }} | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_OWNER: ${{ github.repository_owner }} | |
PRODUCTION_BRANCH: 'main' | |
DEVELOPMENT_BRANCH: 'develop' | |
PR_NUMBER: ${{ github.event.number }} | |
TERMINUS_SITE: 'drupaldocs' | |
jobs: | |
deploy_to_pantheon: | |
name: Deploy to pantheon | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set ownership | |
run: | | |
chown -R $(id -u):$(id -g) $PWD | |
- name: Setup PHP | |
id: setup-php | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
- name: Install Terminus | |
uses: pantheon-systems/terminus-github-actions@main | |
with: | |
pantheon-machine-token: ${{ secrets.TERMINUS_TOKEN }} | |
- name: Install Terminus Build Tools | |
run: | | |
terminus self:plugin:install terminus-build-tools-plugin | |
- name: Checkout source branch | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref || github.ref_name }} | |
fetch-depth: 0 | |
# Deploy to Pantheon Downstream sites | |
- name: Deploy to Pantheon | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "$SSH_PRIVATE_KEY" > ../private.key | |
chmod 600 ../private.key | |
eval `ssh-agent -s` | |
ssh-add ../private.key | |
git config --global --add safe.directory /__w/leaf-home-mapletree/leaf-home-mapletree | |
ssh-add -L | ssh-keygen -l -E md5 -f - | awk '{print substr($2,5)}' | |
.github/dev-multidev.sh |