Last active
August 22, 2023 22:00
-
-
Save joseph-farruggio/ab5bd63e9db6f95861a4ef576a5d8dba to your computer and use it in GitHub Desktop.
Github Action for deploying a WordPress plugin
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: Build and Publish Production Plugin | |
on: | |
push: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install NPM dependencies & Compile assets for production | |
run: | | |
npm install | |
npm run prod | |
- name: List output files | |
run: ls | |
- name: Deploy to Production Server #1 | |
uses: easingthemes/[email protected] | |
env: | |
# To generate a new key: | |
# ssh-keygen -a 100 -t ed25519 | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE }} | |
REMOTE_HOST: ${{ secrets.SSH_HOST }} | |
REMOTE_USER: ${{ secrets.SSH_USER }} | |
ARGS: -rltgoDzvO --exclude .git --exclude .github --exclude node_modules --exclude src --exclude cypress | |
TARGET: /www/wp-content/plugins/{plugin_dir} | |
- name: Deploy to Production Server #2 | |
uses: easingthemes/[email protected] | |
env: | |
# To generate a new key: | |
# ssh-keygen -a 100 -t ed25519 | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE }} | |
REMOTE_HOST: ${{ secrets.SSH_HOST_2 }} | |
REMOTE_USER: ${{ secrets.SSH_USER_2 }} | |
ARGS: -rltgoDzvO --exclude .git --exclude .github --exclude node_modules --exclude src --exclude cypress | |
TARGET: /www/wp-content/plugins/{plugin_dir} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment