GitHub Actions
GitHub Actions let you control the full deploy pipeline: validate config, build your image, push to registry, then notify Holden. This ensures Holden pulls the image you just built, not the previous one.
Why GitHub Actions?
Section titled “Why GitHub Actions?”Native GitHub webhooks fire immediately on push—before your image is built. With GitHub Actions, you control when to notify Holden:
- Validate your config
- Build your Docker image
- Push to registry
- Then trigger Holden
Complete Example
Section titled “Complete Example”name: Build and Deploy
on: push: branches: [main]
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: Validate Holden config uses: holden-run/actions/validate@main
- name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image uses: docker/build-push-action@v6 with: push: true tags: ghcr.io/myorg/myapp:latest
- name: Deploy to Holden uses: holden-run/actions/deploy@main with: webhook-url: ${{ secrets.HOLDEN_WEBHOOK_URL }} app-id: my-app webhook-secret: ${{ secrets.HOLDEN_WEBHOOK_SECRET }}Official Actions
Section titled “Official Actions”actions/validate
Section titled “actions/validate”Validates your holden.yml before building. Catches config errors early, before wasting time on a Docker build.
- uses: holden-run/actions/validate@mainUses the Holden CLI under the hood. Fails the workflow if validation fails.
actions/deploy
Section titled “actions/deploy”Calls Holden’s webhook endpoint with proper HMAC signature.
- uses: holden-run/actions/deploy@main with: webhook-url: ${{ secrets.HOLDEN_WEBHOOK_URL }} app-id: my-app webhook-secret: ${{ secrets.HOLDEN_WEBHOOK_SECRET }}| Input | Required | Description |
|---|---|---|
webhook-url | Yes | Webhook base URL (store in GitHub Secrets as HOLDEN_WEBHOOK_URL) |
app-id | Yes | App ID as registered in Holden |
webhook-secret | Yes | Secret for HMAC signature (store in GitHub Secrets as HOLDEN_WEBHOOK_SECRET) |
Building Images
Section titled “Building Images”Use the official docker/build-push-action to build and push your images. It supports multi-platform builds, layer caching, build arguments, and everything else you’d expect.
Other registries
Section titled “Other registries”The complete example above uses GitHub Container Registry (ghcr.io). For other registries, swap out the login step:
- uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }}- uses: docker/login-action@v3 with: registry: registry.example.com username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }}