Netlify is a web app hosting service that is a great match for Lowdefy. They have great integrations with GitHub, GitLab, and Bitbucket, which make it easy to set up a continuous deployment process to deploy your apps.
Requirements
You will need to have the following:
- A Github account. You can create one here.
- A Netlify account. You can create one here. It is easiest if you sign up with your Github account.
git
version control installed on your computer.
Step 6.1 - Create a Github repository
Create a new Github repository. You can do that here. Do not initialize the repository with a .gitignore
, README
, or licence file.
Step 6.2 - Add your files to the repository
Run the git
commands to create a new repository on the command line:
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/__GITHUB_USERNAME__/__REPO_NAME__.git
git push -u origin main
If you refresh your browser, you should see the lowdefy.yaml
and .gitignore
files in the repository.
Step 6.3 - Link your Github project to Netlify.
- Once logged in to Netlify, click the "New site from git" button.
- Choose Github, and authorize Netlify to access your repositories.
- Select your repository.
Step 6.4 - Configure your Netlify deployment.
- Set your build command to
npx lowdefy@latest build-netlify
. - Set your publish directory to
.lowdefy/publish
. - Review the other settings, and deploy your site
Step 6.5 - Configure the Lowdefy server.
- Click the "Site settings" button.
- Choose the "Functions" section in the left menu.
- Edit the settings and set your functions directory to
.lowdefy/functions
.
Step 6.6 - Add your Google Sheets credentials
Go to "Site settings", then "Build and deploy" in the left menu. Scroll down and select "Edit variables" in the "Environment" section.
Set the variables LOWDEFY_SECRET_SHEETS_CLIENT_EMAIL
and LOWDEFY_SECRET_SHEETS_PRIVATE_KEY
to the same values as in your .env
file.
Step 6.7 - Redeploy your site
- Go to the "Deploys" tab.
- Click the "Trigger deploy" button and deploy your site.
- Wait for you site to finish deploying.
Step 6.8 - Enjoy your app
Go to your shiny new app. On the "Site overview" tab you will find your site url. Go to this url and you should see your app.
Step 6.9 - Try out Netlify's deploy preview.
Edit the lowdefy.yaml
file on Github. Commit the changes on a new branch, and create a pull request. Netlify will run checks on your pull request, and generate a deploy preview. Once the deploy preview has finished building, you can click on the "details" link and this will take you to preview of your changes.
Up next
This is the end of the tutorial. If you have any feedback or suggestions, we would greatly appreciate that. You can start a new discussion here.
Our next steps will show you some of the things you could do next.