Skip to content

tacticlaunch/dokploy-github-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Dokploy Github Action

This GitHub Action triggers a deployment in Dokploy by updating the Docker image for a specific application.

Useful for automating deployments as part of your CI/CD pipeline.


πŸ“¦ Features

  • πŸ”’ Securely authenticates via API token
  • πŸ“¦ Updates a Dokploy application with a new Docker image
  • βš™οΈ Easily integrates into your CI workflows

πŸ› οΈ Usage

Add this step to your GitHub Actions workflow:

name: Build Docker images

on:
  push:
    tags:
      - 'v*'

jobs:
  build-and-push-dockerfile-image:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Log in to GitHub Container Registry
        uses: docker/login-action@v2
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Build and push Docker image
        uses: docker/build-push-action@v4
        with:
          context: .
          file: ./Dockerfile
          push: true
          tags: |
            ghcr.io/${{ github.repository }}:latest
            ghcr.io/${{ github.repository }}:${{ github.sha }}
          platforms: linux/amd64

      - name: Deploy to Dokploy
        uses: tacticlaunch/dokploy-github-action@0.1.0
        with:
          token: ${{ secrets.DOKPLOY_TOKEN }} # Generate in Dokploy settings (Settings -> Profile)
          application_id: ${{ secrets.DOKPLOY_APP_ID }} # From /api/project.all or last id in the application url (`https://DOKPLOY_URL/dashboard/project/jsY-g3aa0j3CjZJtpN18q/services/application/c_ifimm4gStxYSv8PR74R` - `c_ifimm4gStxYSv8PR74R` is app id)
          image: ${{ steps.meta.outputs.tags }} # e.g. ghcr.io/username/app:latest
          base_url: ${{ secrets.DOKPLOY_URL }} # e.g. https://my-dokploy-instance.com

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published