Articles

Deploying a static Astro site with Gitea Actions and Nginx

How this bilingual portfolio verifies its cinematic assets, builds a release on a shared VPS, and rolls back if the new version fails its checks.

A machined aluminum fixture holds two smoked-glass plates on a dark workbench.

This portfolio shares a VPS with ShagerdAI. A portfolio release needs to be repeatable, and a broken page or missing asset needs to be detectable before the deployment counts as successful. The site uses Astro’s static output, so the production server can serve the generated HTML, CSS, JavaScript, and media directly from Nginx. Astro deployment guide

Treat the media as a build input

The portfolio’s scroll-driven homepage has desktop and mobile frame sequences. The source videos and their manifests enter the build through a private, versioned package, while the repository contains the scripts that produce the frames and posters. Gitea Actions imports the media package once for each revision of the footage. A copy edit or an article can then reuse the existing source files on the VPS.

The build checks each video’s hash and technical properties against its manifest before generating WebP frames. This catches the kind of mistake Git alone cannot see, such as a video with the right filename and the wrong bytes.

Build and check before switching traffic

A production push to main starts the Gitea Deploy workflow. The runner sends the selected commit to the VPS, where the release process installs the locked dependencies, builds the media, runs Astro’s checks and the unit tests, and checks the contents of dist/. The output checks cover both languages, canonical links, the sitemap, and the separation between published files and private inputs.

The VPS builds each version in its own directory. Once the output passes, it moves that directory into the releases folder and atomically updates the current symlink that Nginx serves. The running site can keep answering requests while the new build is in progress.

Check the routes a visitor will use

A successful build still leaves one thing to prove: whether Nginx can serve that exact release. After the switch, the deployment checks the release marker over local HTTPS, both localized homepages, the contact pages, the sitemap, and a sample cinematic frame. It expects a missing URL to return a real 404. If a check fails, the script restores the previous release link.

For a small static site, that is the useful part of a deployment pipeline: the version is identifiable, the checks exercise the actual serving path, and a rollback has a clear target. Those habits transfer to larger applications even when their runtime and release tools differ.