Last active
March 15, 2021 18:44
-
-
Save gsarig/c1001f9c7800ff761668035b06a9094e to your computer and use it in GitHub Desktop.
GitHub Action example for a WordPress project
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 to Live server | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: deploy to server | |
uses: AEnterprise/[email protected] | |
env: | |
DEPLOY_KEY: ${{ secrets.SERVER_SSH_KEY }} | |
ARGS: "-rltgoDzvO --exclude /themes/theme-name/sass --exclude node_modules --exclude .github --exclude gulpfile.js --exclude 'phpcs*' --exclude '.*' --exclude package-lock.json" | |
SERVER_PORT: ${{ secrets.REMOTE_PORT }} | |
FOLDER: "./" | |
SERVER_IP: ${{ secrets.REMOTE_HOST }} | |
USERNAME: ${{ secrets.REMOTE_USER }} | |
SERVER_DESTINATION: ${{ secrets.REMOTE_LIVE_TARGET }} | |
- name: Set permissions | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
USERNAME: ${{ secrets.REMOTE_USER }} | |
PORT: ${{ secrets.REMOTE_PORT }} | |
KEY: ${{ secrets.SERVER_SSH_KEY }} | |
script: sudo chown -R ${{ secrets.OWNER_USER }} ${{ secrets.REMOTE_LIVE_TARGET }} ; sudo chmod -R 755 ${{ secrets.REMOTE_LIVE_TARGET }} ; sudo webinoly ${{ secrets.SITE_NAME }} -clear-cache=all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment