A template to quickly start new Java projects.
- A minimal
pom.xml- Environment: Java 17
- Compile dependencies: SLF4J
- Test dependencies: Junit Jupiter, AssertJ, Log4j2 binding for SLF4J
- A
build.ymlfile with a basic Github Action configuration to compile your code and upload coverage results to CodeCov - A
nginx.conffile to quickly get started with your nginx configuration if you want to upload resources related to your project
- Edit
pom.xmland set theartifactIdandname. - Configure your repository in CodeCov: you probably need to enable it, and copy the upload token
- Create a new repository secret:
CODECOV_TOKENand set its value with your upload token - Write some code (and some tests!) and push your work
At this point the Github Action should compile and test your code, and you should be able to see your coverage data in CodeCov.
- Create a new
ADNS record pointing to your server - Edit
nginx.confand replaceserver_namewith the name you specified in your DNS configuration - Create a directory in
/var/www/htmlto store your static content, and editnginx.conf'srootto point to this new directory - Upload
nginx.confto your server (/etc/nginx/sites-available) and give it an appropriate name. Then enable the site with the following command:ln -s /etc/nginx/sites-available/my-app.conf /etc/nginx/sites-enabled/. - (Recommended) Run certbot to get HTTPS certificates for your subdomain
- Create the following repository secrets
CD_HOST: the host for your resources (e.g.myvsp.ovh.net)CD_USERNAME: the user to log as in your server (e.g.bob)CD_PASSWORD: the password of the user you specified
- Uncomment the steps
Generate JavadocandUpload Javadocin.github/workflow/build.yml- Set the
remotepath to point to the directory you created in 3
- Set the
- (Optional) Delete
nginx.conffrom your app directory, you don't need it anymore, it is on your server now