These are the files that you need to make this work:
- Dockerfile
- .github/workflows/deploy.yml
- captain-definition
- default.conf
Go to settings -> Secrets and variables -> actions
Add the following secrets
CAPROVER_SERVER- The server url of your caprover instance. This must be in the format ofhttps://caprover.example.comCAPROVER_NAME- The name of the app you want to deploy toCAPROVER_KEY- The key of the app you want to deploy to
- Set up a caprover instance
- Make sure you have a domain name pointing to the server
- Take the domain name and set it as the
CAPROVER_SERVERsecret in the format ofhttps://caprover.example.com
- Create a new app
- Set the app name to the same as the
CAPROVER_NAMEsecret
- After creating the app, go to
Method 1: Official CLI - Click
Enable App Token - Take the token and set it as the
CAPROVER_KEYsecret
You can find the workflow file in .github/workflows/deploy.yml
The docker file is located in Dockerfile and simply takes the built files from github's build and serves them on port 80
If the built files are not in ./dist then you will need to change the COPY command in the dockerfile to match the location of your built files
- Go to
.github/workflows/deploy.ymland change thedistto match the name of your built folder - Go to
Dockerfileand change thedistto match the name of your built folder