Last active
March 20, 2024 23:11
-
-
Save alphex/7351369afd4c871a5a709425724d73c4 to your computer and use it in GitHub Desktop.
Drupal in github push main to master on Pantheon
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 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