GitLab

How to publish your Astro Site with GitLab Pages

Oct 24, 2022Janis Altherr
How to publish your Astro Site with GitLab Pages
SummaryAI, from the source post

This post provides a step-by-step guide on how to publish an Astro site using GitLab Pages. It details configuring Astro for GitLab Pages by adjusting `astro.config.mjs` to set `outDir` to 'public' and `publicDir` to 'static', and configuring the `base` and `site` properties for correct asset loading. It also outlines the process of setting up a remote repository on GitLab, creating a `.gitlab-ci.yml` file using the Pages wizard with a 'node:lts' build image, and configuring `npm ci` and `npm run build` commands for the pipeline. The post emphasizes the role of the `pages` job in GitLab CI/CD for deploying artifacts from the 'public' directory.

More from the Static Website Hosting with GitLab Pages trail