Skip to content

Instantly share code, notes, and snippets.

@alphex
Last active March 20, 2024 23:11
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/7351369afd4c871a5a709425724d73c4 to your computer and use it in GitHub Desktop.
Save alphex/7351369afd4c871a5a709425724d73c4 to your computer and use it in GitHub Desktop.
Drupal in github push main to master on Pantheon
name: Deploy Master to Pantheon
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: |
echo ${{ secrets.KNOWN_HOSTS }}
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 --force pantheon HEAD:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment