NexaCloud is open to everyone. Free to start, no credit card.Create a free account
NEXACLOUD / GUIDES

Deploy an Astro site.

Publish a static Astro build from GitHub.

Astro builds static sites by default, which makes it a natural fit. This guide publishes an Astro site from GitHub on a free HTTPS address.

1. Create the site and push it

npm create astro@latest my-site cd my-site && npm run build git init && git add . && git commit -m "first commit" git remote add origin https://github.com/YOUR-USER/my-site.git git push -u origin main

Keep Astro in its default static output mode. The build writes to dist.

2. Create the project and add the workflow

  1. Create a free NexaCloud account with GitHub or email.
  2. Open Projects, enter a name, your GitHub owner and repository, and create the project. Copy the deploy token shown once.
  3. In your repository open Settings → Secrets and variables → Actions and add a secret named NEXACLOUD_TOKEN with that token.
  4. Commit the workflow below as .github/workflows/nexacloud.yml and push.
name: Deploy NexaCloud on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: 22 } - run: npm ci && npm run build - name: Send to NexaCloud env: NEXACLOUD_TOKEN: ${{ secrets.NEXACLOUD_TOKEN }} run: | cd dist args=(); while IFS= read -r f; do args+=(-F "${f#./}=@$f"); done < <(find . -type f) curl --fail-with-body -sS -X POST "https://app.nexaclouds.online/api/deploy/my-project" \ -H "Authorization: Bearer $NEXACLOUD_TOKEN" "${args[@]}"

3. Check the result

When the GitHub Actions run is green, open https://my-project.nexaclouds.online. Pages such as src/pages/about.astro are built to about/index.html and served at /about.

Tips

  • Server-side rendering adapters are not supported yet; use static output.
  • Images imported through Astro’s image tools are written as files and deploy normally, within the 5 MB per file limit.