Gitea + Drone CI + Vercel = Gitea Pages

Search for a command to run...

No comments yet. Be the first to comment.
Here is a snippet showing an example of how this would be done. Each animal has a favorite color which we will determine using a switch statement. const animal = "dog"; const color = (()=>{ switch (animal) { case "cat": retur...

Welcome! I couldn't find a simple, straightforward tutorial on how to do this. Everything written here is a summation of the Docker documentation on CentOS, as that is what OL is built upon. I will be using Oracle Linux 8 build 2020.12.17-0, for refe...

Welcome! Strap in because this is gonna be a long ride. To preface, I had an existing media server that I broke some permissions and reinstalling was the only option. I had an existing RAID 0 setup with lots of data I did not want to lose, plus a sta...

How to Install Drone CI for Gitea Welcome! This is a simple tutorial that is heavily based on Drone’s documentation with a minor focus on Oracle Cloud. Without further ado, let’s get into it! Prerequisites Basic computer literacy An Oracle Cloud ac...

Welcome! So this article comes after a year of being annoyed, but lazy, about the lack of functionality within Gitea to produce something similar to GitHub Pages. About a week ago, I finally got fed up and decided to figure it out and put this knowledge online since no one else has written about this and that’s frustrating. After following the steps below, you’ll be able to deploy your static-generated websites from any framework of your choosing (Vue, React, Svelte, Hugo, …) by simply pushing your code to Gitea.
This tutorial assumes a couple of things:
You have basic computer literacy
You have both a working Gitea server as well as a Drone CI server.
You have a repository on your Gitea server that has all of your code ready to be deployed
If you don’t have a Gitea or Drone CI server, check out my other post on how to host these for free. Or click the links below because no one likes extra work. Hosting Gitea on Google Cloud Platform How to Install Drone CI for Gitea
Make an account at https://vercel.com
Click on the Create button, then enter “Drone” as the token name
Click Create Token and save the code that is given to you. We will need this for later and Vercel will not show it again.
Click Done and continue on.
Open Drone and open the repository you want to use
Click Activate Repository
Click Settings
Go to the Secrets section and add a new secret. Name it “NOW_TOKEN”, and give it the value of the token we got from the Vercel setup.
Click ADD A SECRET to save it
In the root of your project, create a file called “.drone.yml”. The contents of which should be as follows:
{% gist https://gist.github.com/ksmarty/9cdbb06683adc98a8c1a1360ded2ca95 %}
secret: required. Don’t touch this either
deploy_name: Change to what you want your Vercel project name to be
prod: Leave this if you want a production build. If you want development builds, remove this line
directory: Only use this if you pre-compiled your code. If not, remove this line
Push the changes to your repository.
Now that you’ve pushed your code, a Drone runner should have pushed your code to Vercel! Fantastic!
Next comes fixing the issues. Vercel may or may not detect your framework correctly. If you go to your dashboard and your project is there, check the link to see if everything worked correctly. If it did, fantastic! You’ve done everything correctly and there is nothing left to setup. Either check out the Extras section below for some cool stuff or continue writing your code! Enjoy!
If Vercel did not detect your framework, follow these steps:
Open your project in Vercel by clicking its name
Click Settings in the top left
Under Build & Development Settings, chose your framework preset. If it’s not listed, chose Other
If the build, output, or development commands listed aren’t correct, click the Override toggle and manually edit the command
Click Save and push your code to Gitea once more. This should fix the issues
If you want to only update production when you push to master, check out the gist below:
{% gist https://gist.github.com/ksmarty/77ee3ec5cfd06bd540be2ec6465988d8 %}
Every branch that isn’t master will push to dev builds and master will now push to production!