Skip to content

Github Actions Integration

This guide shows how to automatically deploy your application to Sliplane using Github Actions. At the end of this guide, you will be able to push to your repository, build your Docker image, push it to Github Container Registry, and deploy it to Sliplane. All automatically.

Setup Steps

  1. Configure Github Repository Settings

    • Go to your repository’s Settings > Actions > General
    • Under “Workflow permissions”, enable “Read and write permissions” Github Actions Settings
  2. Create Github Personal Access Token

  3. Add Registry Credentials to Sliplane

    • Navigate to Registry Credentials
    • Select “ghcr.io” as registry
    • Enter your Github username and PAT token Registry Credentials
  4. Configure Github Secrets

    • In your repository settings, add a new secret named DEPLOY_SECRET
    • Copy the dhs_ part from your Sliplane deploy hook URL (see last screenshot) Secrets
  5. Add Workflow File Create .github/workflows/deploy.yml with the following content:

name: Docker Build and Sliplane Deploy
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/your-name/your-repo:latest
ghcr.io/your-name/your-repo:${{ github.sha }}
- name: Deploy to Sliplane
run: |
curl "https://api.sliplane.io/deploy/your-service-id/${{ secrets.DEPLOY_SECRET }}?tag=${{ github.sha }}"
  1. Update Workflow Configuration In the workflow file above:
    • Replace your-name with your Github username
    • Replace your-repo with your repository name
    • Replace your-service-id with your Sliplane service ID (found in service dashboard) Service Dashboard

Now when you push to the main branch, Github Actions will automatically build your Docker image and deploy it to Sliplane.