Prerequisites
- An Astro project hosted in a Git repository that Harness can access.
- An Astro Deployment.
- A Deployment API token, Workspace API token, or Organization API token.
- Access to Harness.
Deploy template
- Create a Harness CI pipeline and configure it as Remote with a Third-party Git provider.
- Authenticate to your Git provider.
- Choose Cloud for infrastructure, and Linux and ARM64 for platform. If you want to use other infrastructure, see Harness’s guide for implementation.
-
Add a step, then choose Run as the template type from the step library. Use
shfor your shell. Only one step is needed to deploy code from your Git repository to Astro, but you can add more if your use case requires. - Paste the following code into the command prompt and apply changes.
- Add the following environment variables in Harness:
ORGANIZATION_ID: The ID for your Organization.
DEPLOYMENT_ID: The ID for your Deployment.
ASTRO_API_TOKEN: The value for your API token as a secret.
ASTRO_PROJECT_PATH: The default value is /harness/ and is followed by the folder name used in the Git provider for Astro, if applicable.
- Run the pipeline. Harness requires you to save changes before executing. Logs will display any errors.