Skip to content

Instantly share code, notes, and snippets.

@alphex
Last active March 20, 2024 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alphex/471cb459ac4d0857aaa3440268e17ffb to your computer and use it in GitHub Desktop.
Save alphex/471cb459ac4d0857aaa3440268e17ffb to your computer and use it in GitHub Desktop.
Drupal Github Push to Multidev
name: Deploy Branch to Pantheon Multidev
on:
push:
branches:
- '*'
- '!main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.PANTHEON_SSH_KEY }}
config: ${{ secrets.SSH_CONFIG }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
# Install Terminus.
- name: Install Terminus
uses: pantheon-systems/terminus-github-actions@main
with:
pantheon-machine-token: ${{ secrets.PANTHEON_MACHINE_TOKEN }}
- name: Install Terminus Build Tools
run: terminus self:plugin:install terminus-build-tools-plugin
- name: Update Ignore File.
run: terminus build:gitignore:cut
- name: Use Node.js 15.
uses: actions/setup-node@v3
with:
node-version: 15
- name: node builder
run: |
cd static
npm install
gulp build
- name: deployer
env:
pantheon_repo: '${{ secrets.PANTHEON_REPO }}'
pantheon_site_name: '${{ secrets.PANTHEON_SITE_NAME }}'
run: |
BASE_BRANCH=${GITHUB_REF##*/}
git remote add pantheon $pantheon_repo
git config --global user.mail "bot@alphex.com"
git config --global user.name "Alphex Bot"
git add .
git commit -q -m "Rebuild CSS/JS assets"
git push -u --force pantheon HEAD:refs/heads/$BASE_BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment