Deployment

Deploying your site is straightforward with CelestialDocs. This guide will help you set up deployment using GitHub Actions and configure your domain with a CNAME file. Follow the steps below to get your site live.

Deploying with GitHub Actions

CelestialDocs includes a deploy.yml file configured for GitHub Actions to automate the deployment process. Here’s how you can use it:

Steps:

  • Add the deploy.yml File

    Make sure the deploy.yml file is included in your project under the .github/workflows directory. This file contains the workflow configuration to handle the deployment.

  • Configure Your GitHub Repository

    Ensure that your GitHub repository is correctly set up to use GitHub Actions. You may need to grant the necessary permissions and configure your repository settings to enable deployments.

  • Set Up Deployment Secrets

If your deployment requires secrets (e.g., API keys, deployment tokens), add them to your GitHub repository settings:

  • Go to your repository on GitHub.

  • Navigate to Settings > Secrets and variables > Actions.

  • Add your secrets here. For example, you might need to add deployment tokens or API keys for your hosting provider.

  • Trigger the Deployment

    Once the deploy.yml file is in place and your secrets are configured, any push to the main branch (or the branch specified in the workflow) will trigger the deployment. GitHub Actions will automatically build and deploy your site based on the configuration in deploy.yml.

Adding a CNAME File

If you’re using a custom domain, you need to include a CNAME file in the public directory of your project. This file ensures that your site is correctly mapped to your custom domain.

Steps:

  • Create the CNAME File

    In the public directory of your project, create a file named CNAME (with no file extension).

  • Add Your Domain Name

    Open the CNAME file and add your custom domain name. For example:

    www.yourcustomdomain.com
    
  • Commit and Push

    After creating the CNAME file, commit your changes and push them to your repository:

    git add public/CNAME
    git commit -m "Add CNAME file for custom domain"
    git push origin main
    
  • Verify Domain Configuration

    Ensure that your domain is correctly configured with your DNS provider to point to your deployment. This usually involves setting up DNS records such as A records or CNAME records to match your hosting provider’s requirements.

Deploy with other services

Publish your work with the Deploy your site guide in the Astro docs.