Account Settings View
Deploying your website to Vercel is quite straightforward. There are steps that you complete once, and steps that you complete every time you want to deploy a new version.
Initial Setup Overview
- Upload your codebase to GitHub
- Connect your GitHub repository to Vercel
- Deploy your website
- Enable Vercel Analytics
- Set your custom domain name
Deploying a new version
- Make your changes and commit them to the main branch
- Vercel will automatically detect the changes and deploy a new version
Initial Setup
Upload your codebase to GitHub
Create a new local git repository
During setup, you can choose whether you want SwiftyLaunch to initialize a new GitHub repository for your project, if you picked, true, skip this step.
If not, go to your project folder, and initialize a new git repository by running:
git init
Create an initial commit by running:
git add .
git commit -m "Initial commit"
Create a new GitHub remote repository
Go to GitHub (opens in a new tab) (obviously log in), and in the top right corner click on the + icon and select New repository.
Then, give your repository a name, select the visibility (recommended: private), and click on Create repository.
Push your local repository to the remote repository
You will see a page of your new repository, but it will not have any code in it yet. Copy over the following command and paste it into your terminal. After a successfull push, reload the page and you should see your codebase in the remote repository.
Copy this:
Run it in your terminal:
Refresh the page and you should see your codebase in the remote repository:
Connect your GitHub repository to Vercel
Go to Vercel (opens in a new tab), create an account / log in, and click on Add New → Project in the top right corner.
Select your GitHub account, and press on Import next to the repository that we just created.
Here, enter your environment variables (by default, SwiftyLaunch only needs PostHog related variables, if you have enabled AnalyticsKit during setup. These are the veriables that you can find in the .env
file in the root of your project). Press on Deploy.
After a few seconds your project will be built and you should see your deployed project dashboard.
Press on one of the domains to visit your deployed project. Congrats, you've just deployed your website to Vercel!
There are a couple of other steps that we will go through in the next sections.
Enable Vercel Analytics
SwiftyLaunch includes Vercel Analytics out of the box. All thats needed for you is to press on the Enable button in the Vercel dashboard.
After it's done, open your deployed project in the browser and next time you visit the dashboard, you will see the related analytics. It's that simple!
Set your custom domain name
If you have purchased a custom domain name, you can set easily set it up in the Vercel dashboard. Go to Settings → Domains → Add. Follow the steps to add your domain name.
Deploying a new version
Make your changes and commit them to the main remote branch
Make your changes, make sure to add them and commit to the remote branch:
git add .
git commit -m "Your commit message"
git push -u origin main
Deployment
After a few seconds, Vercel will detect changes to your main branch, your project will be built and automatically deployed.
That's it! You've just deployed a new version of your website.