https://github.com/getshifter/shifter-netlify-build-subdir
https://github.com/getshifter/shifter-netlify-build-subdir
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/getshifter/shifter-netlify-build-subdir
- Owner: getshifter
- Created: 2019-11-15T18:43:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-15T20:09:22.000Z (over 6 years ago)
- Last Synced: 2025-03-28T00:28:36.926Z (about 1 year ago)
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shifter Deploy to Netlify as a Subdirectory
Netlify build script and redirects for deploying a static WordPress site from Shifter to Netlify in a subdirectory.
# How to
tl;dr: You have to set up both a Netlify and a Shifter site. They interact and conenct by using a webhook. These steps are an overview of both.
## On Netlify
1. Deploy this to Netlify
1. Navigate to deploy settings, add a build hook
1. Name the build hook, we called ours "Shifter Artifact Webhook", save it
1. Copy the new build hook URL, e.g. "https://api.netlify.com/build_hooks/abc123"
## On Shifter
1. Migrate or launch a new WordPress site on Shifter
1. Select a plan that support webhooks
1. Navigate to webhook settings, paste your Netlify build hook URL, save it
1. Generate a new artifact
## Explained
This process does 2 things. First, it sets up a Netlify site with the required build settings and redirects. Those settings are located within the `netlify.toml` file and `build.sh`.
The `build.sh` includes a few necessary search and replace scripts to enable support for a subdirectory site install such as `example.com/blog`.
The `netlify.toml` file includes the redirects and subdirectory path. In this example, we're using `/blog/`.