Guides & automation
GitHub Actions Integration
Build a container in GitHub Actions, publish it to GHCR, and trigger a Sliplane deployment.
This workflow builds an image, pushes it to GitHub Container Registry (GHCR), and asks Sliplane to deploy that commit's image tag.
Setup Steps
- Create a registry service in Sliplane. Configure it to use
ghcr.io/your-name/your-repo. Publish an initial image before the first Sliplane deployment. Use a lowercase image path. - Allow Sliplane to pull the image. For a private GHCR package, create a classic GitHub personal access token with
read:packagesand access to that package. Add it to Registry Credentials and select the credential for your service. Public images do not require a pull credential. - Store the deploy hook. Copy the complete deploy-hook URL from your Sliplane service. In the GitHub repository's Actions secrets, create
SLIPLANE_DEPLOY_HOOK_URLwith that value. - Add the workflow below. Replace
ghcr.io/your-name/your-repowith your image path.
name: Docker Build and Sliplane Deploy
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
IMAGE: ghcr.io/your-name/your-repo
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: |
${{ env.IMAGE }}:latest
${{ env.IMAGE }}:${{ github.sha }}
- name: Trigger Sliplane deployment
env:
DEPLOY_HOOK_URL: ${{ secrets.SLIPLANE_DEPLOY_HOOK_URL }}
IMAGE_TAG: ${{ github.sha }}
run: |
curl --fail-with-body --silent --show-error \
--connect-timeout 10 --max-time 60 \
--get --data-urlencode "tag=$IMAGE_TAG" \
"$DEPLOY_HOOK_URL"Verify the deployment
The workflow fails if the deploy hook rejects the request. After it succeeds, check the service’s deployment status and logs in Sliplane.
Rotate a deploy hook
If the URL leaks, rotate it in Sliplane, then replace SLIPLANE_DEPLOY_HOOK_URL in GitHub with the new URL. The previous URL stops working immediately.
How is this guide?