This document provides a comprehensive guide on setting up GitHub Actions to automate the deployment of applications to GritivaCore. The goal is to ensure that every push to the main branch triggers a CI/CD pipeline that builds and deploys the application within five minutes.
Create an API key in GritivaCore: Settings → API keys → New key. Copy the grv_… value; it is shown once. You can list the keys that exist later with GET /api/v1/api-keys.
Add it to your GitHub repository:
Navigate to SET. → Secrets and variables → Actions → New repository secret and name it GRITIVA_API_KEY.
Add two more secrets for the rollover step: DEPLOY_SSH_KEY (a private key authorised on the VM) and DEPLOY_HOST (the VM's address). Add the scope's id as GRITIVA_SCOPE_ID — you can read it from GET /api/v1/scopes.
The last step is a gate, not a deploy: it reads the scope back and fails the job if the API does not answer. A healthy scope reports status running and health healthy.
Test the setup by pushing a commit to the main branch and tailing the logs in the GritivaCore panel.
By following this guide, you can successfully set up GitHub Actions to automate your deployment process to GritivaCore, ensuring efficient and reliable application updates.
Best Practices
Best Practices
Consider the following best practices for your GitHub Actions workflows:
- Use per-environment tokens and revoke leaked tokens promptly.
- Avoid using `:latest` tags; prefer image digests for stability.
- Implement pre-build health checks to ensure application readiness.
Further Reading
Further Reading
For deeper insights into GitHub Actions, refer to the [GitHub Actions documentation](https://docs.github.com/en/actions).