Advanced DevOps
August 22, 2026 · Anuron Blog
Anuron / reading room
How to Automatically Deploy GitHub Changes to Production
Take the useful parts with you.

Automatic deployment should mean more than “run a command whenever someone pushes code.” A reliable GitHub-to-production workflow should decide when a deployment is allowed, build the release, run tests, deploy a known version, check that the application is healthy, notify the team, and provide a safe recovery path.
GitHub supports several ways to trigger deployment workflows, including push, pull_request, and workflow_dispatch. It also supports deployment environments, environment secrets, concurrency controls, deployment history, and protection rules. GitHub webhooks provide another event-driven option: when a subscribed event occurs, GitHub sends an HTTP request to an external server that can trigger a CI or deployment process.
Anuron’s supplied application-hosting interface shows a Website or App deployment path from GitHub or Docker. Its supplied strategy materials also list selected application-hosting capabilities such as custom domains, deployment rollback, database backups, scheduled tasks, PR previews, and Docker Compose. The exact GitHub integration mechanism and fields must be verified in the current Anuron dashboard before this guide is turned into a literal click-by-click configuration.
The complete deployment pipeline
A production deployment is a chain of controlled steps rather than a single action.
| Stage | What happens | What should stop the release |
|---|---|---|
| Commit | A developer changes code and pushes a commit or opens a pull request | Protected-branch rules are bypassed or the change has no review path |
| Trigger | GitHub Actions or a verified webhook starts the workflow | The event comes from the wrong branch, repository, or event type |
| Build | Dependencies are installed and the application or image is built | Dependency failure, compile error, invalid configuration, or failed image build |
| Test | Unit, integration, lint, security, and smoke checks run | Any required test fails or coverage/security policy is violated |
| Deploy | The verified Anuron integration or deployment endpoint receives the approved release | Credential failure, incorrect target, rejected artifact, or unavailable service |
| Health check | The workflow checks the application’s health endpoint and essential user path | Non-2xx response, timeout, failed database connection, or elevated error response |
| Notify | GitHub status and team notification record the result | Notification failure should be visible but should not hide deployment state |
| Recover | The team rolls back or redeploys a known-good commit/image | No versioned artifact, no rollback procedure, or untested recovery path |
The most important design choice is to make the deployed version identifiable. A release should point to an immutable commit SHA, image digest, or version tag rather than an ambiguous moving label such as “latest.” This makes debugging and rollback much easier.
Push trigger versus GitHub webhook
There are two common architectures for automatic deployment.
GitHub Actions deploys after a push
In this model, GitHub Actions is the orchestrator. A push to a selected branch starts a workflow. The workflow checks out the code, installs dependencies, runs tests, and calls the verified Anuron deployment integration or endpoint.
This approach keeps build and deployment history close to the source repository. It is usually a strong default when the build must run in GitHub and the target platform provides a supported deployment action, API, webhook receiver, or authenticated command.
Anuron receives a GitHub webhook
In this model, GitHub sends a push event to a verified Anuron URL. The receiving integration decides whether the repository, branch, and event should create a deployment. GitHub documents webhooks as an event-driven way to trigger external CI and deploy to a production server.
This can be simpler when Anuron owns the deployment orchestration. However, the webhook must be authenticated, filtered, observable, and protected against duplicate deliveries. GitHub’s delivery can be retried, so the receiver should be idempotent: the same event should not create uncontrolled duplicate releases.
Do not configure both a GitHub Actions deployment and an Anuron webhook for the same production branch unless you intentionally want two independent deployment paths. Otherwise, one push may produce two production releases.
A safe branch and environment model
A practical setup uses three conceptual stages: pull request validation, staging, and production. Pull requests run builds and tests without production credentials. A merge into the protected production branch may deploy to staging automatically. Production deployment then requires a protected GitHub environment, a verified Anuron integration, or an explicit approval step.
GitHub environments can hold environment-scoped secrets and deployment protection rules. A job that references an environment must satisfy its protection rules before it can run or access that environment’s secrets. This is useful for keeping production credentials away from ordinary test jobs.
You should also use concurrency control for production. If commit A starts deploying and commit B is pushed immediately afterward, the workflow should define whether B waits, cancels A, or is serialized behind it. The answer depends on the deployment system, but it should be deliberate rather than accidental.
Example GitHub Actions workflow
The following example demonstrates the control flow. The final deployment step is intentionally a placeholder because the exact Anuron integration method, endpoint, action, and authentication fields have not been confirmed from the supplied materials.
name: Production deployment
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: production
cancel-in-progress: false
jobs:
test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Check out the commit
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint --if-present
- name: Run tests
run: npm test --if-present
- name: Build
run: npm run build --if-present
deploy:
name: Deploy to Anuron
needs: test
runs-on: ubuntu-latest
environment:
name: production
url: https://YOUR-PRODUCTION-DOMAIN.example
steps:
- name: Deploy the approved commit through the verified Anuron integration
env:
ANURON_DEPLOY_TOKEN: ${{ secrets.ANURON_DEPLOY_TOKEN }}
COMMIT_SHA: ${{ github.sha }}
run: |
echo "Replace this placeholder with Anuron's documented deployment action, API call, or integration command."
echo "Deploying commit ${COMMIT_SHA}"
- name: Wait for deployment
run: sleep 15
- name: Health check
env:
HEALTHCHECK_URL: https://YOUR-PRODUCTION-DOMAIN.example/health
run: |
curl --fail --silent --show-error --retry 5 --retry-delay 5 "$HEALTHCHECK_URL"
- name: Report deployment metadata
run: |
echo "Deployed ${GITHUB_SHA} to production"
This workflow is a reference structure, not a ready-to-run Anuron integration. Replace the placeholder with the exact integration documented by Anuron. Do not invent an endpoint, token format, GitHub Action, or command and present it as official.
Configure the verified GitHub integration on Anuron
Once the integration is confirmed in the Anuron dashboard, configure it in this order.
1. Confirm the integration type
Determine whether Anuron expects a GitHub repository connection, a GitHub webhook, a GitHub Actions call, a deployment API, or another supported mechanism. The configuration and security model differ for each option.
If it is a webhook, record the exact target URL, accepted event, branch filter, expected content type, signature method, and response behavior. If it is a GitHub Actions integration, record the required action or API endpoint, token permissions, repository mapping, and deployment target.
2. Map the repository and production branch
Connect only the intended repository and select the branch that represents production. A common choice is main, but the correct branch is the one protected by your team’s review and release policy. Confirm whether the integration deploys every push, only tagged releases, or only manually approved releases.
3. Store credentials securely
Production credentials belong in GitHub environment secrets or the secure credential fields provided by the verified Anuron integration. GitHub states that environment secrets are available only to jobs referencing the relevant environment and after required protection rules pass.
Use the narrowest credential scope possible. A deployment token should not be a general-purpose administrator credential if a deploy-only credential is available. Never place a token in source code, a Dockerfile, a public issue, a screenshot, or a command that will be stored in a build log.
4. Configure the build and runtime
Specify the runtime version, package installation command, build command, start command, required environment variables, and any database or service dependencies. Keep non-sensitive configuration visible and versioned where practical, while injecting secrets at deployment time.
If Anuron supports deployment from a Docker image, use an immutable image tag or digest tied to the GitHub commit. If it builds directly from the repository, make sure the platform uses the intended lockfile and build configuration.
5. Define the health check
A deployment is not complete merely because the build succeeded. Configure a health endpoint that verifies the application process is running and, where appropriate, that required dependencies are reachable. Keep the endpoint fast and avoid exposing sensitive diagnostic information.
At minimum, check the expected HTTP status, response time, and a small set of critical application behavior. For a database-backed service, consider a safe connectivity check that does not mutate production data.
6. Test rollback before the first incident
A rollback should identify the previous known-good commit or image and redeploy it through the same controlled path. Confirm whether Anuron’s current application-hosting plan provides a documented rollback control, whether the rollback restores only application code or also data/configuration, and how database migrations are handled.
Application rollback cannot automatically undo an irreversible database migration. Use backward-compatible migrations, expand-and-contract patterns, and a tested database restore procedure for schema changes.
Notifications and auditability
The team should be able to answer four questions after every release: what changed, who approved it, what version is running, and whether the health check passed. GitHub Actions provides workflow-run and deployment history views, while the Anuron side should be checked for deployment history, logs, and status visibility.
Send failure notifications to the channel your team actually monitors. A useful notification includes the repository, branch, commit SHA, actor, environment, deployment result, health-check result, and a link to the workflow run. Avoid sending secrets or full environment values in the notification.
Common failure modes
| Failure | Likely cause | Safer response |
|---|---|---|
| Workflow never starts | Wrong branch/event filter or workflow syntax | Test with workflow_dispatch, inspect Actions permissions, and confirm the branch name |
| Build passes locally but fails in CI | Runtime or dependency mismatch | Pin versions, use the lockfile, and reproduce with the same build command |
| Deployment is rejected | Invalid credential, wrong project, or unsupported integration field | Recheck the verified Anuron integration documentation and token scope |
| App deploys but is unhealthy | Missing environment variable, port mismatch, migration issue, or dependency failure | Inspect deployment logs, verify configuration, and use a health endpoint |
| Two releases deploy for one push | Actions and webhook paths are both active | Keep one production trigger or explicitly coordinate the two paths |
| Rollback does not restore the service | Data migration or persistent state changed | Design backward-compatible migrations and test application-plus-data recovery |
| Secrets appear in logs | Debug output or unsafe command interpolation | Rotate the secret, remove the output, and use masked environment secrets |
Should every commit deploy to production?
No. Automatic production deployment is appropriate when the repository has strong tests, protected branches, reliable observability, a reversible release process, and a team that accepts the risk. For higher-risk applications, deploy every approved merge to staging and require a production approval through a GitHub environment or the verified Anuron control.
A useful progression is to begin with automatic build and test on every pull request, automatic staging deployment after merge, manual production approval, and automated health checks. Once the team trusts the process, production promotion can become more automatic for low-risk services.
Final checklist
Before enabling automatic GitHub-to-production deployment, confirm that the repository and production branch are protected, the workflow runs build and tests, production secrets are environment-scoped, concurrency behavior is defined, the Anuron integration is verified, the deployed version is identifiable, the health endpoint is safe, notifications are configured, logs are accessible, rollback has been tested, and database migrations have a recovery plan.
Configure Anuron’s verified GitHub integration
Anuron’s application-hosting workflow is designed to provide a simpler path from a GitHub or Docker source to a running application. Open Anuron’s hosting and application-deployment options, confirm the current GitHub integration fields and supported plan, then configure the repository, production branch, secure credentials, health check, and rollback behavior before enabling automatic production releases.
Continue reading
