-
-
Save kongondo/a52ebb21ffce1a2a43d6e75facf3214f to your computer and use it in GitHub Desktop.
Use GitHub actions to set up automated deployment of WordPress site via SSH on any hosting provider
This file contains hidden or 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: Hostinger SSH Deployment | |
on: | |
push: | |
branches: [main] | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- uses: "shivammathur/setup-php@v2" | |
with: | |
php-version: "8.2" | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16.x" | |
- name: Install npm dependencies | |
run: npm install | |
- name: Run build task | |
run: npm run production | |
- name: Deploy to Server | |
uses: easingthemes/ssh-deploy@main | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | |
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | |
REMOTE_PORT: ${{ secrets.REMOTE_PORT }} | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
ARGS: "-rltgoDzvO" | |
EXCLUDE: "/.git/, /.github/, /.hygen/, /node_modules/" | |
TARGET: public_html/wp-content/themes/tailpress-master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment