- If you don't have one - create a free Deploy Now account You won't regret it - promised! โ
- Because Laravel takes more than 50MB in deployment (that's the maximum storage quota of free projects),
you can join our PHP alpha and we give your more space to get it run ๐ - If you just created a Deploy Now account - log in to it and connect your Github account
- Now you have two choices...
- Then select this repository in Deploy Now under "Deploy from my own Github repository"
- Select Static M as project package
That's all the magic. While we building and deploying - have a cup of coffee. Okay, just a little one, because we're fast! ๐ After that - you can visit your deployed Laravel site, you find the link at your Deploy Now dashboard. And if you change something in your (new) repository and commit it - we build again, you drink a small coffee again, ... and your changes are online. ๐
This repository is based on a completely normal composer created fresh Laravel installation. With a little pinch of tailwindcss and IONOS branding. In this commit you can find the files that are doing the magic. And if you are a great magician and understand it, you can adapt it to your own project. Please welcome with a big applause...
To put this file to your document root is important, because we can't change the web root in our infrastructure. Because of that we'll have to forward all requests to the directory that would be web root, if we could change it... ๐ Furthermore we enable gzip-compression.
This file we take during project setup to create the Github workflow file in your repository. After you setup your project you find a commit at this repository that added .github/workflow/deploy-now.yml
to your repo. If you want it that way, .ionos.yaml
is a template file that helps Deploy Now to create the github workflow (with composer install
, npm install
and npm run build
, ...). Important: changings at this file only working if you make them before setting up project with Deploy Now. After project is set up, this file is ignored. In this case you have to edit .github/workflow/deploy-now.yml
directly.
If you edit this file before project creation, you can specify the build process on Github. Use node
or not!? Set build params for composer!? Run artisan tests!? Specify vars for .env
!?
Imporant All the things you specify here, especially the php commands, are running on Github runners, not on your actual webspace!
This file contains all the stuff that we do before/after every deployment on your actual webspace. In contrast to .ionos.yaml
, changes at this file are taken into account at each deployment. Don't want to clear caches after deployment, because it's hard for you to let things go? ๐ฐ No problem, just delete php8.0-cli artisan optimize:clear
from .deploy-now/config.yaml
, commit it and find your luck with not cleared caches! ๐
There are two parts in this file that looks very similar, but are very different. On line 5 you find bootstrap
- this part from line 5 to line 31 - is only taken at the first deployment of each branch. Here you can create for example a sqlite database.
On line 34 - 55 you find the recurring
part. This part is executed at every deployment after the first deployment.
At both parts you have the same three keys:
excludes
- folders and files that shouldn't be synced to webspace, rsync syntax
pre-deployment-remote-commands
- commands/actions that should run on webspace before files from deployment are copied (e.g. enable maintenance mode, dump database, ...)
post-deployment-remote-commands
- commands/actions that should run on webspace after files from deployment are copied (e.g. migrate database, clear and warmup caches, set file permissions, ...)
Yeah, you can try it! Please read the paragraph below and add the three files to your repository. We would recommend you a feature branch. ๐ Then you can edit the files the way you need it.
This sample comes with a sqlite database, that's working the Laravel way - migrations included. Feel free to use it!
If you want to use MySQL or MariaDB - we have to disappoint you, we can't offer you this kind of databases as a feature in Deploy Now at the moment. But we're working hard on it. ๐ช
If you got a MySQL/MariaDB server that is reachable from outside, you can put the access data to it to the part of .ionos.yaml
/.github/workflow/deploy-now.yml
where the env vars file is generated. We recommend you to put the access data into Github secrets. ๐ Now commit it and it should work!
It's - like the configuration of database - only an env variables job. Add your mail access data to the env vars part of .ionos.yaml
/.github/workflow/deploy-now.yml
. Best way to do it - via Github secrets.
It's okay, man! ๐ Our infrastructure is able to run applications with PHP 5.3 too. But at the moment there is no way for you to define the PHP version of the webserver. If you can't use PHP 8.0 - please contact us and we are setting up your environment with your wished PHP version. In future it will be possible to define the PHP version for each branch in the Deploy Now dashboard.
What you can change already is the cli-version of PHP. Just find and replace php8.0-cli
in .deploy-now/config.yaml
with php5.3-cli
. Or php7.4-cli
. Or....okay, we think you got it! Important: if you call php
without any version, you got php4.4
๐ฌ That's the reason you can't call ./artisan
directly.
The PHP version that is used on the Github runners in composer action you can specify in .github/workflow/deploy-now.yml
. Please take a look at the documentation of this composer action.
If you have any suggestions, requests, questions, please get in touch with us. Write us directly via Deploy Now dashboard or send a mail to [email protected]. We do our best to make you happy! ๐
IONOS Deploy Now - made with โค๏ธ by us in Karlsruhe, Germany