Skip to content

Instantly share code, notes, and snippets.

@naeluh
Last active March 30, 2023 23:11
Show Gist options
  • Save naeluh/4a54db925b52d04061d2840dec795bd9 to your computer and use it in GitHub Desktop.
Save naeluh/4a54db925b52d04061d2840dec795bd9 to your computer and use it in GitHub Desktop.
name: Deploy to Pantheon
on: push
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
# Check Terminus works.
- name: Update Ignore File.
run: terminus build:gitignore:cut
- name: Use Node.js 14.
uses: actions/setup-node@v3
with:
node-version: 14.19.0
# Cache vendor folder
- name: Cache vendor folder
uses: actions/cache@v2
env:
cache-name: cache-vendor
with:
path: ./vendor
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
- name: node builder
run: |
npm install
gulp build
- name: deployer
env:
pantheon_repo: '${{ secrets.PANTHEON_REPO }}'
run: |
BASE_BRANCH=${GITHUB_REF##*/}
git remote add pantheon $pantheon_repo
git config user.mail "[email protected]"
git config user.name "TAG Bot"
git add .
git commit -q -m 'Build assets for dev.'
git push --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