Skip to content

Instantly share code, notes, and snippets.

@doreybenjamin
Last active April 22, 2023 15:00
Show Gist options
  • Save doreybenjamin/a0e2153894c923409be857017f0b2fbe to your computer and use it in GitHub Desktop.
Save doreybenjamin/a0e2153894c923409be857017f0b2fbe to your computer and use it in GitHub Desktop.
Deploy to Kinsta Github Actions Bedrock/Sage10
#Go in your kinsta serv with ssh in terminal and make this two steps :
#1: cat ~/.ssh/id_rsa.pub and copy paste in user setting in kinsta and SSH KEY
#2: cat ~/.ssh/id_rsa and copy paste in secret SSH_KEY
name: Deploy to Kinsta
on:
pull_request:
types: [ labeled ]
push:
branches: [ main ]
jobs:
deploy:
if: github.actor == 'dependabot[bot]' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
env:
SSH_PORT: ${{ secrets.PORT }} #1547
SSH_HOST: ${{ secrets.HOST }} #0.0.0.0
SSH_KEY: ${{ secrets.SSH_KEY }}
KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }} #0.0.0.0:1547
SSH_USERNAME: ${{ secrets.USERNAME }} #username
KINSTA_FOLDER: ${{ secrets.REMOTE_DIR }} #/var/www/public
DOMAIN: ${{ secrets.DOMAIN }} #url.com
THEME: 'themename'
steps:
- uses: actions/checkout@v3
- name: Bedrock installation
uses: proG-Grenoble/bedrock-build-actions@v1
- name: Sage installation
uses: proG-Grenoble/sage-build-actions@v1
with:
theme: ${{ env.THEME }}
ssh_port: ${{ env.SSH_PORT }}
ssh_username: ${{ env.SSH_USERNAME }}
ssh_host: ${{ env.SSH_HOST }}
kinsta_folder: ${{ env.KINSTA_FOLDER }}
ssh_key: ${{ env.SSH_KEY }}
known_hosts: ${{ env.KNOWN_HOSTS }}
- name: Flush Wordpress & Sage
uses: proG-Grenoble/flush-wp-sage-actions@v1
with:
theme: ${{ env.THEME }}
ssh_port: ${{ env.SSH_PORT }}
ssh_username: ${{ env.SSH_USERNAME }}
ssh_host: ${{ env.SSH_HOST }}
kinsta_folder: ${{ env.KINSTA_FOLDER }}
domain: ${{ env.DOMAIN }}
ssh_key: ${{ env.SSH_KEY }}
known_hosts: ${{ env.KNOWN_HOSTS }}
- name: Flush Kinsta Cache
uses: proG-Grenoble/kinsta-cache-actions@v1
with:
theme: ${{ env.THEME }}
ssh_port: ${{ env.SSH_PORT }}
ssh_username: ${{ env.SSH_USERNAME }}
ssh_host: ${{ env.SSH_HOST }}
kinsta_folder: ${{ env.KINSTA_FOLDER }}
domain: ${{ env.DOMAIN }}
ssh_key: ${{ env.SSH_KEY }}
known_hosts: ${{ env.KNOWN_HOSTS }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment