Skip to content

Commit c6eb097

Browse files
authored
Update Vercel setup instructions (#193)
* Updates for current default Vercel build image. * Suggest `APP_URL` for Vercel, and clean up whole instructions section a bit more * Add temporary workaround to build.sh example for breadcrumbs tag issues. * Words.
1 parent 4ecf355 commit c6eb097

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ You may configure a custom routing style in `config/statamic/ssg.php`:
8484

8585
```php
8686
'pagination_route' => '{url}/{page_name}/{page_number}',
87-
```
87+
```
8888

8989

9090
## Post-generation callback
@@ -162,16 +162,14 @@ Deployments are triggered by committing to Git and pushing to GitHub.
162162

163163
- Create a site in your [Netlify](https://netlify.com) account
164164
- Link the site to your desired GitHub repository
165-
- Add build command `php please ssg:generate` (if you need to compile css/js, be sure to add that command too and execute it before generating the static site folder. e.g. `npm install && npm run build && php please ssg:generate`).
166-
- Set publish directory `storage/app/static`
167-
168-
After your site has an APP_URL...
169-
170-
- Set it as an environment variable. Add `APP_URL` `https://thats-numberwang-47392.netlify.com`
171-
172-
Finally, generate an `APP_KEY` to your .env file locally using `php artisan key:generate` and copy it's value, then...
173-
174-
- Set it as an environment variable. Add `APP_KEY` `[your app key value]`
165+
- Set build command to `php please ssg:generate`
166+
- If you need to compile css/js, be sure to add that command too and execute it before generating the static site folder
167+
- ie. `npm install && npm run build && php please ssg:generate`
168+
- Set publish directory to `storage/app/static`
169+
- Add `APP_KEY` env variable, by running `php artisan key:generate` locally, and copying from your `.env`
170+
- ie. `APP_KEY` `your-app-key-value`
171+
- Add `APP_URL` environment variable after your site has a configured domain
172+
- ie. `APP_URL` `https://thats-numberwang-47392.netlify.com`
175173

176174
#### S3 Asset Containers
177175

@@ -204,26 +202,28 @@ Be sure to also update these in your `s3` disk configuration:
204202

205203
Deployments are triggered by committing to Git and pushing to GitHub.
206204

207-
- Create a new file called `./build.sh` and paste the code snippet below.
208-
- Run `chmod +x build.sh` on your terminal to make sure the file can be executed when deploying.
205+
- Create a new file called `./build.sh` and paste the code snippet below
206+
- Run `chmod +x build.sh` on your terminal to make sure the file can be executed when deploying
209207
- Import a new site in your [Vercel](https://vercel.com) account
210208
- Link the site to your desired GitHub repository
211-
- Add build command `./build.sh`
209+
- Set build command to `./build.sh`
210+
- See [example build script](#example-build-script), which you'll also need to add to your project
212211
- Set output directory to `storage/app/static`
213-
- Add environment variable in your project settings: `APP_KEY` `<copy & paste from dev>`
212+
- Add `APP_KEY` env variable, by running `php artisan key:generate` locally, and copying from your `.env`
213+
- ie. `APP_KEY` `your-app-key-value`
214+
- Add `APP_URL` environment variable after your site has a configured domain
215+
- ie. `APP_URL` `https://thats-numberwang-47392.vercel.app`
214216

215-
#### Code for build.sh
217+
#### Example Build Script
216218
Add the following snippet to `build.sh` file to install PHP, Composer, and run the `ssg:generate` command:
217219

218220
```
219221
#!/bin/sh
220222
221223
# Install PHP & WGET
222-
yum install -y amazon-linux-extras
223-
amazon-linux-extras enable php8.2
224-
yum clean metadata
225-
yum install php php-{common,curl,mbstring,gd,gettext,bcmath,json,xml,fpm,intl,zip,imap}
226-
yum install wget
224+
dnf clean metadata
225+
dnf install -y php8.2 php8.2-{common,mbstring,gd,bcmath,xml,fpm,intl,zip}
226+
dnf install -y wget
227227
228228
# INSTALL COMPOSER
229229
EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
@@ -247,6 +247,7 @@ php composer.phar install
247247
php artisan key:generate
248248
249249
# BUILD STATIC SITE
250+
php please stache:warm -n -q
250251
php please ssg:generate
251252
```
252253

0 commit comments

Comments
 (0)