{"id":20276265,"url":"https://github.com/ilanvivanco/wpe-deployment-action","last_synced_at":"2025-05-07T16:33:33.756Z","repository":{"id":48342612,"uuid":"391196746","full_name":"IlanVivanco/wpe-deployment-action","owner":"IlanVivanco","description":"This repo has been archived and moved to extend capabilities and add support for a new server. NEW REPO:","archived":true,"fork":false,"pushed_at":"2024-10-24T13:02:02.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-18T13:05:32.164Z","etag":null,"topics":["action","actions","deploy","deployment","github-actions"],"latest_commit_sha":null,"homepage":"https://github.com/IlanVivanco/wp-deployment-action","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IlanVivanco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-30T22:04:43.000Z","updated_at":"2024-10-24T13:03:58.000Z","dependencies_parsed_at":"2023-01-05T05:03:17.931Z","dependency_job_id":null,"html_url":"https://github.com/IlanVivanco/wpe-deployment-action","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"cda4fac280c77cd5cf28cb8fb058995c5e708003"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlanVivanco%2Fwpe-deployment-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlanVivanco%2Fwpe-deployment-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlanVivanco%2Fwpe-deployment-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlanVivanco%2Fwpe-deployment-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IlanVivanco","download_url":"https://codeload.github.com/IlanVivanco/wpe-deployment-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252915628,"owners_count":21824614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action","actions","deploy","deployment","github-actions"],"created_at":"2024-11-14T13:13:04.098Z","updated_at":"2025-05-07T16:33:28.746Z","avatar_url":"https://github.com/IlanVivanco.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automatic WordPress deployment to WP Engine\n\n\u003e [!WARNING]  \n\u003e This repo has been archived and moved [here](https://github.com/IlanVivanco/wp-deployment-action), to extend capabilities and add support for a new server.\n\nThis GitHub Action can be used to set automatic deployments using an SSH private key and **rsync**.\n\nBy default, the action will deploy the repository root directory, but you can optionally deploy a theme, plugin, or any other directory using the `SOURCE_PATH`. Likewise, if you need to specify a different destination directory, you can do so using `PUBLISH_PATH`.\n\nAfter the deployment, this action will also purge your WP Engine cache and flush permalinks to ensure all changes are visible.\n\n## GitHub Action workflow\n\n1. Set up your [SSH key](#setting-up-your-ssh-key) on WP Engine.\n\n1. Create a new YML file in the directory `.github/workflows/` in the root of your repository. You can choose any name, e.g., `deploy.yml`.\n\n1. Add the following code to this new file, replacing values for `PRD_BRANCH` and `PRD_ENV` accordingly.\n\n   **`\u003e .github/workflows/deploy.yml`**\n\n   ```yml\n   name: 📦 Deploy to WP Engine\n   on:\n      push:\n      workflow_dispatch:\n\n   jobs:\n      build:\n         name: 🚩 Starting deployment job\n         runs-on: ubuntu-latest\n         steps:\n            - name: 🚚 Getting latest code\n            uses: actions/checkout@v2\n\n            - name: 🔁 Deploying to WP Engine\n            uses: IlanVivanco/wpe-deployment-action@main\n            env:\n               # Deployment options.\n               WPE_SSH_KEY: ${{ secrets.WPE_SSH_KEY }}\n               SOURCE_PATH: ''\n               PUBLISH_PATH: ''\n\n               # You must, at least, set the production environment.\n               PRD_BRANCH: main\n               PRD_ENV: prodinstall\n\n               # Uncomment this for setting a staging environment.\n               # STG_BRANCH: staging\n               # STG_ENV: stageinstall\n\n               # Uncomment this for setting a development environment.\n               # DEV_BRANCH: dev\n               # DEV_ENV: devinstall\n   ```\n\n1. Finally, push the latest changes to the repository, the action will do the rest.\n\n   ![Magic](https://media.giphy.com/media/l3V0dy1zzyjbYTQQM/giphy.gif)\n\n\u003e ℹ You can have multiple branches deploying to the same install by separating them with a comma, e.g., `PRD_BRANCH: main, dev, staging` will deploy all three branches to the WP Engine production environment. Using regex here, well help you to extend this to even more branches, e.g., `main, feature(/.*)?` will deploy the _main_ banch and also the _feature_ or _feature/anything_ branches.\n\n## Setting up your SSH key\n\n1. [Generate a new SSH key pair](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) as a special deploy key between your GitHub Repo and WP Engine. The simplest method is to generate a key pair with a blank passphrase, which creates an unencrypted private key.\n\n1. Add the public SSH key to your [WP Engine SSH Keys](https://wpengine.com/support/ssh-gateway/#Add_SSH_Key) configuration panel.\n\n1. Store the private key in the GitHub repository as new [GitHub encrypted secret](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) using the name `WPE_SSH_KEY` save it —this can be customized if you change the secret name in the yml file to call it correctly—.\n\n## Ignoring files\n\nIf you want some files to be ignored upon deployment, you can create a `.deployignore` file on your source directory, adding the exclude patterns —one per line—. Blank lines and lines starting with _#_ will be ignored.\n\n**`\u003e .deployignore`**\n\n```bash\n# Exclude rules\nbin\ncomposer*\ndist\ngulp*\nnode_modules\npackage*\nphpcs*\nsrc\nvendor\n```\n\n## Environment variables\n\n### Required\n\n| Name          | Type      | Usage                                                                                     |\n| ------------- | --------- | ----------------------------------------------------------------------------------------- |\n| `WPE_SSH_KEY` | _secrets_ | Authorized SSH private key for deployment. See [SSH key usage](#setting-up-your-ssh-key). |\n| `PRD_BRANCH`  | _string_  | Name of the branch you would like to deploy from, e.g., \"_main_\".                         |\n| `PRD_ENV`     | _string_  | Name of the WP Engine Prod environment you want to deploy to.                             |\n\n### Optional\n\n| Name           | Type     | Usage                                                                                                                       |\n| -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |\n| `STG_BRANCH`   | _string_ | Name of the staging branch you would like to deploy from.                                                                   |\n| `STG_ENV`      | _string_ | Name of the the WP Engine Stage environment you want to deploy to.                                                          |\n| `DEV_BRANCH`   | _string_ | Name of the a development branch you would like to deploy from.                                                             |\n| `DEV_ENV`      | _string_ | Name of the the WP Engine Dev environment you want to deploy to.                                                            |\n| `SOURCE_PATH`  | _string_ | Path to specify a theme, plugin, or any other directory source to deploy from. Defaults to the repository root.             |\n| `PUBLISH_PATH` | _string_ | Path to specify a theme, plugin, or any other directory destination to deploy to. Defaults to the WordPress root directory. |\n| `FAIL_CODE`    | _number_ | Code number to be used if the action fails (0 = success and 1 = error). Defaults to 1.                                      |\n\n### Additional Resources\n\n-  [Generate a new SSH key pair](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)\n-  [Setting up SSH on WP Engine](https://wpengine.com/support/ssh-gateway/)\n-  [Storing secrets in GitHub](https://docs.github.com/en/actions/reference/encrypted-secrets)\n\n### Contributing\n\nContributions to this action are always welcome and highly encouraged.\n\n### License \u0026 Attribution\n\n-  Licensed as MIT \u0026copy; [Ilán Vivanco](https://ilanvivanco.com) 2021.\n\n-  This action is based on the work made by Alex Zuniga on [GitHub Action for WP Engine Site Deployments](https://github.com/wpengine/github-action-wpe-site-deploy).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filanvivanco%2Fwpe-deployment-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filanvivanco%2Fwpe-deployment-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filanvivanco%2Fwpe-deployment-action/lists"}