{"id":4864,"date":"2022-11-18T13:18:08","date_gmt":"2022-11-18T19:18:08","guid":{"rendered":"https:\/\/wpengine.com\/builders\/?p=4864"},"modified":"2023-06-21T09:20:11","modified_gmt":"2023-06-21T14:20:11","slug":"branched-deploys-wp-engine-github-actions","status":"publish","type":"post","link":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/","title":{"rendered":"Branched Deploys to WP Engine with GitHub Actions"},"content":{"rendered":"\n<p>It should be no surprise that WP Engine sites come with multiple environments: production, staging, and development. Today I want to show how to set up a simple deployment process for your WP Engine site. We&#8217;ll cover the following concepts:<\/p>\n\n\n\n<div class=\"wp-block-group has-polar-background-color has-background has-global-padding is-layout-constrained wp-container-core-group-is-layout-2a9f3359 wp-block-group-is-layout-constrained\" style=\"padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--40)\">\n<p class=\"has-large-font-size\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0\"><strong>Table of contents<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\" style=\"margin-top:var(--wp--preset--spacing--30);margin-right:var(--wp--preset--spacing--30);margin-bottom:var(--wp--preset--spacing--30);margin-left:var(--wp--preset--spacing--30)\">\n<li><a href=\"#initialize-git-for-local\">Initializing Git for our Local WordPress site<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#smart-plugin-manager\">Smart Plugin Manager<\/a><\/li>\n\n\n\n<li><a href=\"#repo-organization\">Repo organization and <code>.gitignore<\/code><\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#integrate-github-actions\">Integrate GitHub Actions into the repo<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#generate-ssh-key\">Generate SSH key<\/a><\/li>\n\n\n\n<li><a href=\"#add-public-key\">Add <strong>public<\/strong> SSH key to WP Engine portal<\/a><\/li>\n\n\n\n<li><a href=\"#add-private-key-to-github\">Add <strong>private<\/strong> SSH key to GitHub repo<\/a><\/li>\n\n\n\n<li><a href=\"#add-wpe-github-actions\">Add WP Engine GitHub Actions<\/a><\/li>\n\n\n\n<li><a href=\"#verify-github-actions\">Verifying GitHub Actions<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-group alignwide has-base-color has-lapis-heliotrope-gradient-background has-text-color has-background has-link-color wp-elements-cb731890a6eb8c9e6d49cef36aa5d258 has-global-padding is-layout-constrained wp-container-core-group-is-layout-a666d811 wp-block-group-is-layout-constrained\" style=\"padding-top:var(--wp--preset--spacing--40);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--40)\">\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-f1189ed3 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-outermost-icon-block\"><div class=\"icon-container has-icon-color has-curry-color\" style=\"color:#FFCB52;width:48px\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"-2 -2 24 24\" aria-hidden=\"true\"><path d=\"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z\"><\/path><\/svg><\/div><\/div>\n\n\n\n<p class=\"has-large-font-size\"><strong>February 2023 update<\/strong> \u2013 Bitbucket support<\/p>\n<\/div>\n\n\n\n<p>WP Engine now supports Bitbucket pipeline integration.<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/bitbucket.org\/wpengine\/wpe-site-deploy\/src\/main\/\" target=\"_blank\" rel=\"noreferrer noopener\">View the full WP Engine Bitbucket integration documentation<\/a>.<\/strong><\/p>\n<\/div>\n\n\n\n<p>By the end of this tutorial, you&#8217;ll be able to push changes to a designated branch, and it will automatically deploy those changes to a respective WP Engine environment.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>GitHub branch<\/th><th>WP Engine environment<\/th><\/tr><\/thead><tbody><tr><td><code>main<\/code><\/td><td><code>production<\/code><\/td><\/tr><tr><td><code>stage<\/code> <\/td><td><code>staging<\/code><\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Each branch deploys to a WP Engine environment<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Branched deploys to WP Engine with GitHub Actions\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/VfB18iyKiVc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>We&#8217;re going to start from the very beginning. Let me introduce you to my new client: Qorp. Qorp has engaged my expertise in creating a new WordPress site for them and they&#8217;re eager to get their site launched on WP Engine&#8217;s hosting platform. <\/p>\n\n\n\n<p>I&#8217;ve had several meetings with Qorp, and we&#8217;ve nailed down the requirements for the site. I&#8217;ve already started creating a sandbox site on my computer using WP Engine&#8217;s <a href=\"https:\/\/localwp.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Local<\/a>. I&#8217;ve made good progress dialing in a WordPress theme and even created a simple WordPress plugin to register a simple custom block I&#8217;m developing for their site.<\/p>\n\n\n\n<p>Now, I need to take my sandbox site in Local, put it under version control, and deploy the code to the client&#8217;s staging environment for them to review.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"initialize-git-for-local\">Initialize Git for our Local WordPress site<\/h2>\n\n\n\n<p>Let&#8217;s start using Local&#8217;s &#8220;Open site shell&#8221; to open our command line tool. You can access this by either right-clicking on the site or directly below the site title; there is also an &#8220;Open site shell&#8221; option.<\/p>\n\n\n\n<figure class=\"wp-block-image alignwide size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1352\" height=\"963\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/local-open-side-shell-options.png\" alt=\"Screenshot of Local app with &quot;Open site shell&quot; menu items highlighted\" class=\"wp-image-4873\" srcset=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/local-open-side-shell-options.png 1352w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/local-open-side-shell-options-300x214.png 300w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/local-open-side-shell-options-1024x729.png 1024w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/local-open-side-shell-options-768x547.png 768w\" sizes=\"auto, (max-width: 1352px) 100vw, 1352px\" \/><\/figure>\n\n\n\n<p>Once our command line tool opens, it will drop us into the root of our WordPress site&#8217;s installation on our local computer&#8217;s hard drive. We&#8217;ll want to move into the <code>wp-content\/<\/code> directory. So, type <code>cd wp-content<\/code> and <kbd>Enter<\/kbd> to drop into the <code>wp-content\/<\/code> directory. Now we can run <code>git init<\/code> to initialize Git version control in our <code>wp-content\/<\/code> directory. Now the entire directory is under version control. \ud83d\udca5<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"smart-plugin-manager\">Smart Plugin Manager<\/h3>\n\n\n\n<p>However, we don&#8217;t want the entire <code>wp-content\/<\/code> directory under version control because we&#8217;ll utilize WP Engine&#8217;s <a href=\"https:\/\/wpengine.com\/support\/smart-plugin-manager\/\" target=\"_blank\" rel=\"noreferrer noopener\">Smart Plugin Manager<\/a> to maintain the updates on most of our everyday plugins, like Yoast SEO and Safe SVG. <\/p>\n\n\n\n<p>Smart Plugin Manager automates the overhead of updating our WordPress plugins and is smart enough to detect critical errors during the upgrade process and roll back if anything is detected. We can assure Qorp that their site will always be up to date with the latest WordPress core files and the latest WordPress plugin updates, which should help both parties feel confident and secure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"repo-organization\">Repo organization and <code>.gitignore<\/code><\/h3>\n\n\n\n<p>We can create a <code>.gitignore<\/code> file in our <code>wp-content\/<\/code> directory to tell Git what we want to ignore in our version control.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Current WordPress site directory structure<\/th><th class=\"has-text-align-center\" data-align=\"center\">Do we want to version control?<\/th><\/tr><\/thead><tbody><tr><td><code>wp-content\/index.php<\/code><\/td><td class=\"has-text-align-center\" data-align=\"center\">No<\/td><\/tr><tr><td><code>wp-content\/plugins\/wordpress-seo\/<\/code><\/td><td class=\"has-text-align-center\" data-align=\"center\">No<\/td><\/tr><tr><td><code>wp-content\/plugins\/safe-svg<\/code><\/td><td class=\"has-text-align-center\" data-align=\"center\">No<\/td><\/tr><tr><td><code>wp-content\/plugins\/qorp-plugin<\/code><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-dollabillz-color\">Yes<\/mark><\/strong><\/td><\/tr><tr><td><code>wp-content\/themes\/qorp-theme<\/code><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-dollabillz-color\">Yes<\/mark><\/strong><\/td><\/tr><tr><td><code>wp-content\/themes\/twentytwentythree<\/code><\/td><td class=\"has-text-align-center\" data-align=\"center\">No<\/td><\/tr><tr><td><code>wp-content\/themes\/twentytwentytwo<\/code><\/td><td class=\"has-text-align-center\" data-align=\"center\">No<\/td><\/tr><tr><td><code>wp-content\/upgrade<\/code><\/td><td class=\"has-text-align-center\" data-align=\"center\">No<\/td><\/tr><tr><td><code>wp-content\/uploads<\/code><\/td><td class=\"has-text-align-center\" data-align=\"center\">No<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Comparing the current WordPress folder structure vs. what we want to version control<\/figcaption><\/figure>\n\n\n\n<p>We&#8217;ll use the table above and create our <code>.gitignore<\/code> file based on this desired structure. First, type <code>touch .gitignore<\/code> to create a new <code>.gitignore<\/code> file and open it in your code editor of choice (\ud83d\ude09 I recommend VS Code, and if you already have it installed, then type <code>code .<\/code> to open the current directory).<\/p>\n\n\n\n<p>Here is what we&#8217;ll want in our <code>.gitignore<\/code> to properly organize our ignore folders and files.<\/p>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-container-core-group-is-layout-19e250f3 wp-block-group-is-layout-constrained\">\n<p class=\"has-text-align-center has-polar-background-color has-background has-small-font-size\" style=\"padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><code><a href=\"https:\/\/github.com\/colorful-tones\/wpe-gh-action-demo\/blob\/main\/.gitignore\" target=\"_blank\" rel=\"noreferrer noopener\">.gitignore<\/a><\/code><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span><span class=\"hljs-comment\">#---------------------------<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># Themes<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">#---------------------------<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># Ignore all themes<\/span>\n<\/span><\/span><span class='shcb-loc'><span>\/themes<span class=\"hljs-comment\">\/*<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># Except this one theme<\/span>\n<\/span><\/span><mark class='shcb-loc'><span><span class=\"hljs-comment\">!\/themes\/qorp-theme<\/span>\n<\/span><\/mark><span class='shcb-loc'><span><span class=\"hljs-comment\"><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">#---------------------------<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># Plugins<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># Check out WPE's Smart<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># Plugin Manager (SMP)<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">#---------------------------<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># Ignore all plugins<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">\/plugins\/*<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># Except this one plugin<\/span>\n<\/span><\/span><mark class='shcb-loc'><span><span class=\"hljs-comment\">!\/plugins\/qorp-plugin<\/span>\n<\/span><\/mark><span class='shcb-loc'><span><span class=\"hljs-comment\"><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">#---------------------------<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># MU plugins: these are<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># managed by the platform.<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">#---------------------------<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">\/mu-plugins\/<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">#---------------------------<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># Uploads directory<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">#---------------------------<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">\/uploads\/<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"><\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">#---------------------------<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\"># Upgrade files<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">#---------------------------<\/span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-comment\">\/upgrade\/<\/span>\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre><\/div>\n\n\n\n<p>With this <code>.gitignore<\/code> saved, we should see our VS Code update to show the following folders ignored in the Explorer.<\/p>\n\n\n\n<div class=\"wp-block-columns alignwide is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-container-core-column-is-layout-69fcd244 wp-block-column-is-layout-flow\" style=\"padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\">\n<p class=\"has-text-align-center has-polar-background-color has-background has-small-font-size\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\">VS Code Explorer with <strong>empty<\/strong> <code>.gitignore<\/code> file<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"819\" height=\"873\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-no-gitignore.png\" alt=\"Screenshot of VS Code editor with file structure highlighted\" class=\"wp-image-4872\" srcset=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-no-gitignore.png 819w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-no-gitignore-281x300.png 281w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-no-gitignore-768x819.png 768w\" sizes=\"auto, (max-width: 819px) 100vw, 819px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-container-core-column-is-layout-69fcd244 wp-block-column-is-layout-flow\" style=\"padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\">\n<p class=\"has-text-align-center has-polar-background-color has-background has-small-font-size\" style=\"margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\">VS Code Explorer with <strong>ideal<\/strong><code>.gitignore<\/code> file<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"818\" height=\"873\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-gitignore.png\" alt=\"Screenshot of VS Code editor with folder structure \" class=\"wp-image-4871\" srcset=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-gitignore.png 818w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-gitignore-281x300.png 281w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-gitignore-768x820.png 768w\" sizes=\"auto, (max-width: 818px) 100vw, 818px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>We&#8217;ll need to commit our changes and push them up to our GitHub remote repository, which we assume you already created with your GitHub account. <\/p>\n\n\n\n<p>First, we&#8217;ll add our remote repository: <code>git remote add origin https:\/\/github.com\/[your-username]\/[your-repo].git<\/code>. <em>Be sure to replace that last string with your remote GitHub URL.<\/em><\/p>\n\n\n\n<p>Next, we&#8217;ll commit our work and push it up to this newly added remote with the following commands:<\/p>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-container-core-group-is-layout-19e250f3 wp-block-group-is-layout-constrained\">\n<p class=\"has-text-align-center has-polar-background-color has-background has-small-font-size\" style=\"padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\">Commit and push to remote GitHub repo<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span>git add -A\n<\/span><\/span><span class='shcb-loc'><span>git commit -m <span class=\"hljs-string\">'\ud83d\udca5 initial commit'<\/span>\n<\/span><\/span><span class='shcb-loc'><span>git push -u origin main\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"integrate-github-actions\">Integrate GitHub Actions into repo<\/h2>\n\n\n\n<p>Now we have our repository organized and pushed to the remote. Next, we&#8217;ll start incorporating our GitHub Actions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"generate-ssh-key\">Generate SSH key<\/h3>\n\n\n\n<p>For our GitHub Actions to be able to interact with our WP Engine site, we need to utilize an SSH key. <\/p>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-container-core-group-is-layout-19e250f3 wp-block-group-is-layout-constrained\">\n<p class=\"has-text-align-center has-polar-background-color has-background has-small-font-size\" style=\"padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\">Generate a new SSH key. <em>Be sure to replace the last bit with your own file name.<\/em><br>Hit&nbsp;<em>enter<\/em>&nbsp;or&nbsp;<em>return<\/em>&nbsp;to leave the passphrase blank.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span>ssh-keygen -t ed25519 -f ~<span class=\"hljs-regexp\">\/.ssh\/<\/span>wpengine_qorp\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-public-key\">Add public SSH key to WP Engine portal<\/h3>\n\n\n\n<p>We need to add your newly generated SSH key to the WP Engine user portal. <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Visit the User <strong>Portal &gt; Profile &gt; <a href=\"https:\/\/my.wpengine.com\/profile\/ssh_keys\" target=\"_blank\" rel=\"noreferrer noopener\">SSH Keys area<\/a><\/strong><\/li>\n\n\n\n<li>Click the &#8216;Create SSH key&#8217; button (top, right side)<\/li>\n\n\n\n<li>We&#8217;ll need to copy your newly created SSH key&#8217;s <strong>public<\/strong> file. Open your command line tool and run the following command to copy the public key to your clipboard: <code>pbcopy &lt; ~\/.ssh\/wpengine_qorp.pub<\/code> (Be sure to replace the last bit with <em>your<\/em> file name)<\/li>\n\n\n\n<li>Paste the public key into the &#8216;New SSH key&#8217; modal and click the &#8216;Add SSH key&#8217; button<\/li>\n<\/ol>\n\n\n\n<p>You should now see your SSH key among the &#8216;My SSH keys&#8217;.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-private-key-to-github\">Add private SSH key to GitHub repo<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to your GitHub repo&#8217;s <strong>Settings<\/strong> tab &gt; <strong>Secrets<\/strong> &gt; <strong>Actions<\/strong><\/li>\n\n\n\n<li>Click the &#8216;New repository secret&#8217; button (top, right side)<\/li>\n\n\n\n<li>We&#8217;ll need to copy your newly created SSH key&#8217;s <strong>private<\/strong> file contents. Open your command line tool and run the following command to copy the private key to your clipboard: <code>pbcopy &lt; ~\/.ssh\/wpengine_qorp<\/code> (Be sure to replace the last bit with <em>your<\/em> file name)<\/li>\n\n\n\n<li>Paste the private key into the &#8216;Secret&#8217; field and the &#8216;Name&#8217; field should be: <code>WPE_SSHG_KEY_PRIVATE<\/code> and click the &#8216;Add secret&#8217; to save.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image alignwide size-full has-custom-border is-style-border\"><img loading=\"lazy\" decoding=\"async\" width=\"1456\" height=\"1181\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/github-settings-repository-secret.png\" alt=\"Screenshot of GitHub repo's Settings &gt; Actions Secrets screen\" class=\"has-border-color has-polar-border-color wp-image-4882\" srcset=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/github-settings-repository-secret.png 1456w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/github-settings-repository-secret-300x243.png 300w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/github-settings-repository-secret-1024x831.png 1024w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/github-settings-repository-secret-768x623.png 768w\" sizes=\"auto, (max-width: 1456px) 100vw, 1456px\" \/><figcaption class=\"wp-element-caption\">Screenshot of GitHub repo&#8217;s Settings &gt; Secrets &gt; Actions screen<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-wpe-github-actions\">Add WP Engine GitHub Actions<\/h3>\n\n\n\n<p>We&#8217;re almost done. We have our GitHub repository organized, our SSH keys generated and installed on WP Engine&#8217;s portal, and our private SSH key is saved in our repo&#8217;s Action Secrets. Now, we have to write and add our GitHub repo&#8217;s workflow action, which makes all the magic \ud83e\ude84 happen.<\/p>\n\n\n\n<p>Lucky for us, the existing <a href=\"https:\/\/github.com\/marketplace\/actions\/deploy-wordpress-to-wp-engine\" target=\"_blank\" rel=\"noreferrer noopener\">Deploy WordPress to WP Engine GitHub Actions<\/a> are readily available and well documented.<\/p>\n\n\n\n<p>We&#8217;ll add a <code>.github\/workflows<\/code> directory within the root of our repository (Hint: we&#8217;re using <code>wp-content\/<\/code> as the root in this tutorial). We&#8217;ll then want to add two YAML files into this new directory:<\/p>\n\n\n\n<figure class=\"wp-block-image alignwide size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1856\" height=\"1552\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-workflows.png\" alt=\"Screenshot of VS Code with workflows directory highlighted in Explorer\" class=\"wp-image-4885\" srcset=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-workflows.png 1856w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-workflows-300x251.png 300w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-workflows-1024x856.png 1024w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-workflows-768x642.png 768w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/vs-code-workflows-1536x1284.png 1536w\" sizes=\"auto, (max-width: 1856px) 100vw, 1856px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>.github\/workflows\/main.yml<\/code> \ud83d\udc48 handles the deploy to our <strong>production<\/strong> site<\/li>\n\n\n\n<li><code>.github\/workflows\/stage.yml<\/code> \ud83d\udc48 handles the deploy to our <strong>staging<\/strong> site<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-group alignwide has-global-padding is-layout-constrained wp-container-core-group-is-layout-19e250f3 wp-block-group-is-layout-constrained\">\n<p class=\"has-text-align-center has-polar-background-color has-background has-small-font-size\" style=\"padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><code><a href=\"https:\/\/github.com\/colorful-tones\/wpe-gh-action-demo\/blob\/main\/.github\/workflows\/main.yml\" target=\"_blank\" rel=\"noreferrer noopener\">main.yml<\/a><\/code><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span>name: Deploy to production\n<\/span><\/span><span class='shcb-loc'><span>on:\n<\/span><\/span><span class='shcb-loc'><span>  push:\n<\/span><\/span><span class='shcb-loc'><span>    branches:\n<\/span><\/span><mark class='shcb-loc'><span>     - main\n<\/span><\/mark><span class='shcb-loc'><span>jobs:\n<\/span><\/span><span class='shcb-loc'><span>  build:\n<\/span><\/span><span class='shcb-loc'><span>    runs-on: ubuntu-latest\n<\/span><\/span><span class='shcb-loc'><span>    steps:\n<\/span><\/span><span class='shcb-loc'><span>    - uses: actions\/checkout@v2\n<\/span><\/span><span class='shcb-loc'><span>    - name: GitHub Action Deploy to WP Engine\n<\/span><\/span><span class='shcb-loc'><span>      uses: wpengine\/github-action-wpe-site-deploy@v3\n<\/span><\/span><span class='shcb-loc'><span>      with:\n<\/span><\/span><span class='shcb-loc'><span>      <span class=\"hljs-comment\"># Deploy vars<\/span>\n<\/span><\/span><mark class='shcb-loc'><span>        WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPE_SSHG_KEY_PRIVATE }}\n<\/span><\/mark><mark class='shcb-loc'><span>        WPE_ENV: qorp\n<\/span><\/mark><span class='shcb-loc'><span>        <span class=\"hljs-comment\"># Deploy Options<\/span>\n<\/span><\/span><span class='shcb-loc'><span>        REMOTE_PATH: <span class=\"hljs-string\">\"wp-content\/\"<\/span>\n<\/span><\/span><span class='shcb-loc'><span>        PHP_LINT: <span class=\"hljs-keyword\">TRUE<\/span>\n<\/span><\/span><span class='shcb-loc'><span>        CACHE_CLEAR: <span class=\"hljs-keyword\">TRUE<\/span>\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre><\/div>\n\n\n\n<div class=\"wp-block-group alignwide has-global-padding is-layout-constrained wp-container-core-group-is-layout-19e250f3 wp-block-group-is-layout-constrained\">\n<p class=\"has-text-align-center has-polar-background-color has-background has-small-font-size\" style=\"padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\"><code><a href=\"https:\/\/github.com\/colorful-tones\/wpe-gh-action-demo\/blob\/main\/.github\/workflows\/stage.yml\" target=\"_blank\" rel=\"noreferrer noopener\">stage.yml<\/a><\/code><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span>name: Deploy to staging\n<\/span><\/span><span class='shcb-loc'><span>on:\n<\/span><\/span><span class='shcb-loc'><span>  push:\n<\/span><\/span><span class='shcb-loc'><span>    branches:\n<\/span><\/span><mark class='shcb-loc'><span>     - stage\n<\/span><\/mark><span class='shcb-loc'><span>jobs:\n<\/span><\/span><span class='shcb-loc'><span>  build:\n<\/span><\/span><span class='shcb-loc'><span>    runs-on: ubuntu-latest\n<\/span><\/span><span class='shcb-loc'><span>    steps:\n<\/span><\/span><span class='shcb-loc'><span>    - uses: actions\/checkout@v2\n<\/span><\/span><span class='shcb-loc'><span>    - name: GitHub Action Deploy to WP Engine\n<\/span><\/span><span class='shcb-loc'><span>      uses: wpengine\/github-action-wpe-site-deploy@v3\n<\/span><\/span><span class='shcb-loc'><span>      with:\n<\/span><\/span><span class='shcb-loc'><span>      <span class=\"hljs-comment\"># Deploy vars<\/span>\n<\/span><\/span><mark class='shcb-loc'><span>        WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPE_SSHG_KEY_PRIVATE }}\n<\/span><\/mark><mark class='shcb-loc'><span>        WPE_ENV: qorpstg\n<\/span><\/mark><span class='shcb-loc'><span>        <span class=\"hljs-comment\"># Deploy Options<\/span>\n<\/span><\/span><span class='shcb-loc'><span>        REMOTE_PATH: <span class=\"hljs-string\">\"wp-content\/\"<\/span>\n<\/span><\/span><span class='shcb-loc'><span>        PHP_LINT: <span class=\"hljs-keyword\">TRUE<\/span>\n<\/span><\/span><span class='shcb-loc'><span>        CACHE_CLEAR: <span class=\"hljs-keyword\">TRUE<\/span>\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre><\/div>\n\n\n\n<p>Some key takeaways from the <code>main.yml<\/code> and <code>stage.yml<\/code> files:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Line 5:<\/strong> represents the GitHub branch that is associated with deploy. Further reading: GitHub Docs &gt; Using workflows &gt; <a href=\"https:\/\/docs.github.com\/en\/actions\/using-workflows\/workflow-syntax-for-github-actions#using-filters\" target=\"_blank\" rel=\"noreferrer noopener\">Workflow Syntax: Using filters<\/a><\/li>\n\n\n\n<li><strong>Line 15:<\/strong> <code>WPE_SSHG_KEY_PRIVATE<\/code> \u2013 This points to the repo&#8217;s Action Secret variable that we added above: &#8220;<a href=\"#add-private-key-to-github\">Add private SSH key to GitHub repo<\/a>.&#8221;<\/li>\n\n\n\n<li><strong>Line 16:<\/strong> <code>WPE_ENV<\/code> \u2013 This must match the WP Engine environment and represent your target environment.<\/li>\n<\/ul>\n\n\n\n<p><a href=\"https:\/\/github.com\/marketplace\/actions\/deploy-wordpress-to-wp-engine#environment-variables--secrets\" target=\"_blank\" rel=\"noreferrer noopener\">Here is a full list and description of all of the deploy options for the Deploy WordPress to WP Engine workflow<\/a>.<\/p>\n\n\n\n<p>With those files added to your repository, you need to commit and push them up to trigger your first deployment:<\/p>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-container-core-group-is-layout-19e250f3 wp-block-group-is-layout-constrained\">\n<p class=\"has-text-align-center has-polar-background-color has-background has-small-font-size\" style=\"padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\">Commit, push and your first deploy will be triggered<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span>git add -A\n<\/span><\/span><span class='shcb-loc'><span>git commit -m <span class=\"hljs-string\">\"\u2795 ADD: GitHub Action workflows\"<\/span>\n<\/span><\/span><span class='shcb-loc'><span>git push\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre><\/div>\n\n\n\n<p>If you want to also deploy to your staging site then run the following commands to create a new <code>stage<\/code> branch, push and deploy:<\/p>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-container-core-group-is-layout-19e250f3 wp-block-group-is-layout-constrained\">\n<p class=\"has-text-align-center has-polar-background-color has-background has-small-font-size\" style=\"padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\">Create <code>stage<\/code> branch, push and deploy to staging environment<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span>git checkout -b stage\n<\/span><\/span><span class='shcb-loc'><span>git push -u origin stage\n<\/span><\/span><\/code><\/span><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"verify-github-actions\">Verifying GitHub Actions<\/h3>\n\n\n\n<p>You can view pending, successful and failed deploys by visiting your repo&#8217;s Actions tab.<\/p>\n\n\n\n<figure class=\"wp-block-image alignwide size-full has-custom-border is-style-border\"><img loading=\"lazy\" decoding=\"async\" width=\"1726\" height=\"885\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/github-actions-overview-1.png\" alt=\"GitHub Actions tab with overview of workflows run\" class=\"has-border-color has-polar-border-color wp-image-4887\" srcset=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/github-actions-overview-1.png 1726w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/github-actions-overview-1-300x154.png 300w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/github-actions-overview-1-1024x525.png 1024w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/github-actions-overview-1-768x394.png 768w, https:\/\/wpengine.com\/builders\/wp-content\/uploads\/github-actions-overview-1-1536x788.png 1536w\" sizes=\"auto, (max-width: 1726px) 100vw, 1726px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>Having continuous deployment set up with GitHub Actions can keep things running smoothly. In another upcoming tutorial, we&#8217;ll demonstrate how to leverage tools like Composer to manage dependencies and even run code linting to inspect your code for consistency and bugs.<\/p>\n\n\n\n<p>Also, keep in mind that there are many different ways to organize and deploy code. Let us know how you&#8217;re maintaining your ideal workflow\u2014tag me on Twitter <a href=\"https:\/\/twitter.com\/dcook\" target=\"_blank\" rel=\"noreferrer noopener\">@dcook<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn to set up branched deploys with GitHub Actions.<\/p>\n","protected":false},"author":11,"featured_media":4883,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_EventAllDay":false,"_EventTimezone":"","_EventStartDate":"","_EventEndDate":"","_EventStartDateUTC":"","_EventEndDateUTC":"","_EventShowMap":false,"_EventShowMapLink":false,"_EventURL":"","_EventCost":"","_EventCostDescription":"","_EventCurrencySymbol":"","_EventCurrencyCode":"","_EventCurrencyPosition":"","_EventDateTimeSeparator":"","_EventTimeRangeSeparator":"","_EventOrganizerID":[],"_EventVenueID":[],"_OrganizerEmail":"","_OrganizerPhone":"","_OrganizerWebsite":"","_VenueAddress":"","_VenueCity":"","_VenueCountry":"","_VenueProvince":"","_VenueState":"","_VenueZip":"","_VenuePhone":"","_VenueURL":"","_VenueStateProvince":"","_VenueLat":"","_VenueLng":"","_VenueShowMap":false,"_VenueShowMapLink":false,"footnotes":""},"categories":[1],"tags":[13,12,11,14],"class_list":["post-4864","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-deploy","tag-git","tag-github","tag-github-action"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Branched Deploys to WP Engine with GitHub Actions - Builders<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Branched Deploys to WP Engine with GitHub Actions - Builders\" \/>\n<meta property=\"og:description\" content=\"Learn to set up branched deploys with GitHub Actions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/\" \/>\n<meta property=\"og:site_name\" content=\"Builders\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-18T19:18:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-21T14:20:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/branch-deploys-wpe-github-actions-og.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Damon Cook\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/branch-deploys-wpe-github-actions-og.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@dcook\" \/>\n<meta name=\"twitter:site\" content=\"@wpebuilders\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Damon Cook\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/\"},\"author\":{\"name\":\"Damon Cook\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/person\\\/9d8d20c8a321b90faceae588fcf6d30d\"},\"headline\":\"Branched Deploys to WP Engine with GitHub Actions\",\"datePublished\":\"2022-11-18T19:18:08+00:00\",\"dateModified\":\"2023-06-21T14:20:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/\"},\"wordCount\":1391,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/wpe-github-actions-pt1.png\",\"keywords\":[\"deploy\",\"Git\",\"GitHub\",\"GitHub Action\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/\",\"name\":\"Branched Deploys to WP Engine with GitHub Actions - Builders\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/wpe-github-actions-pt1.png\",\"datePublished\":\"2022-11-18T19:18:08+00:00\",\"dateModified\":\"2023-06-21T14:20:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/#primaryimage\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/wpe-github-actions-pt1.png\",\"contentUrl\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/wpe-github-actions-pt1.png\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/branched-deploys-wp-engine-github-actions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Branched Deploys to WP Engine with GitHub Actions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#website\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/\",\"name\":\"Builders\",\"description\":\"Reimagining the way we build with WordPress.\",\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#organization\",\"name\":\"WP Engine\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/WP-Engine-Horizontal@2x.png\",\"contentUrl\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/WP-Engine-Horizontal@2x.png\",\"width\":348,\"height\":68,\"caption\":\"WP Engine\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/wpebuilders\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCh1WuL54XFb9ZI6m6goFv1g\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/person\\\/9d8d20c8a321b90faceae588fcf6d30d\",\"name\":\"Damon Cook\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/18d75285d6803fab88b7f45601bb68cbac7c3956347217c06a0291e27dc65f6a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/18d75285d6803fab88b7f45601bb68cbac7c3956347217c06a0291e27dc65f6a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/18d75285d6803fab88b7f45601bb68cbac7c3956347217c06a0291e27dc65f6a?s=96&d=mm&r=g\",\"caption\":\"Damon Cook\"},\"description\":\"Damon Cook is a Developer Advocate at WP Engine. Previously, he navigated the WordPress agency land for a decade. He is a purveyor and discoverer of musical frisson. He can be found in the realms of WordPress Slack, WooCommerce Slack, and Twitter.\",\"sameAs\":[\"https:\\\/\\\/x.com\\\/dcook\"],\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/author\\\/damon-cook\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Branched Deploys to WP Engine with GitHub Actions - Builders","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/","og_locale":"en_US","og_type":"article","og_title":"Branched Deploys to WP Engine with GitHub Actions - Builders","og_description":"Learn to set up branched deploys with GitHub Actions.","og_url":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/","og_site_name":"Builders","article_published_time":"2022-11-18T19:18:08+00:00","article_modified_time":"2023-06-21T14:20:11+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/branch-deploys-wpe-github-actions-og.jpg","type":"image\/jpeg"}],"author":"Damon Cook","twitter_card":"summary_large_image","twitter_image":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/branch-deploys-wpe-github-actions-og.jpg","twitter_creator":"@dcook","twitter_site":"@wpebuilders","twitter_misc":{"Written by":"Damon Cook","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/#article","isPartOf":{"@id":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/"},"author":{"name":"Damon Cook","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/person\/9d8d20c8a321b90faceae588fcf6d30d"},"headline":"Branched Deploys to WP Engine with GitHub Actions","datePublished":"2022-11-18T19:18:08+00:00","dateModified":"2023-06-21T14:20:11+00:00","mainEntityOfPage":{"@id":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/"},"wordCount":1391,"commentCount":0,"publisher":{"@id":"https:\/\/wpengine.com\/builders\/#organization"},"image":{"@id":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/#primaryimage"},"thumbnailUrl":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/wpe-github-actions-pt1.png","keywords":["deploy","Git","GitHub","GitHub Action"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/","url":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/","name":"Branched Deploys to WP Engine with GitHub Actions - Builders","isPartOf":{"@id":"https:\/\/wpengine.com\/builders\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/#primaryimage"},"image":{"@id":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/#primaryimage"},"thumbnailUrl":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/wpe-github-actions-pt1.png","datePublished":"2022-11-18T19:18:08+00:00","dateModified":"2023-06-21T14:20:11+00:00","breadcrumb":{"@id":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/#primaryimage","url":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/wpe-github-actions-pt1.png","contentUrl":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/wpe-github-actions-pt1.png","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/builders\/branched-deploys-wp-engine-github-actions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/builders\/"},{"@type":"ListItem","position":2,"name":"Branched Deploys to WP Engine with GitHub Actions"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/builders\/#website","url":"https:\/\/wpengine.com\/builders\/","name":"Builders","description":"Reimagining the way we build with WordPress.","publisher":{"@id":"https:\/\/wpengine.com\/builders\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/builders\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wpengine.com\/builders\/#organization","name":"WP Engine","url":"https:\/\/wpengine.com\/builders\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/logo\/image\/","url":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/05\/WP-Engine-Horizontal@2x.png","contentUrl":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/05\/WP-Engine-Horizontal@2x.png","width":348,"height":68,"caption":"WP Engine"},"image":{"@id":"https:\/\/wpengine.com\/builders\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/wpebuilders","https:\/\/www.youtube.com\/channel\/UCh1WuL54XFb9ZI6m6goFv1g"]},{"@type":"Person","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/person\/9d8d20c8a321b90faceae588fcf6d30d","name":"Damon Cook","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/18d75285d6803fab88b7f45601bb68cbac7c3956347217c06a0291e27dc65f6a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/18d75285d6803fab88b7f45601bb68cbac7c3956347217c06a0291e27dc65f6a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18d75285d6803fab88b7f45601bb68cbac7c3956347217c06a0291e27dc65f6a?s=96&d=mm&r=g","caption":"Damon Cook"},"description":"Damon Cook is a Developer Advocate at WP Engine. Previously, he navigated the WordPress agency land for a decade. He is a purveyor and discoverer of musical frisson. He can be found in the realms of WordPress Slack, WooCommerce Slack, and Twitter.","sameAs":["https:\/\/x.com\/dcook"],"url":"https:\/\/wpengine.com\/builders\/author\/damon-cook\/"}]}},"_links":{"self":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts\/4864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/comments?post=4864"}],"version-history":[{"count":0,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts\/4864\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/media\/4883"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/media?parent=4864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/categories?post=4864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/tags?post=4864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}