A GitHub action to build a docker image, upload it to GitHub Packages and then deploy it to a CapRover server.
Follow steps 1 through 8 listed here CapRover CI/CD Integration. Once you have done these, have a Dockerfile in your repo and have the secrets set up, create the action to deploy it using this.
Required GITHUB_TOKEN needed to upload built image to packages. Provide using `${{ secrets.GITHUB_TOKEN }}`
Required Captain URL for your CapRover server. Ex. https://captain.example.com.
Required Admin password for your CapRover server. Please put this in a Repo/Org environment secret and use it like this, `${{ secrets.CAPROVER_PASSWORD }}`.
Required Application name to deploy this repo to on the CapRover server. Application must have been already created.
uses: JasirZaeem/caprover-deploy@v1.2
with:
token: ${{ secrets.CAPROVER_PASSWORD }}
server: "https://captain.example.com"
password: ${{ secrets.CAPROVER_PASSWORD }}
app: "application"name: 'Deploy to Caprover'
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
caprover-deploy:
runs-on: ubuntu-latest
steps:
# Checking out to the correct repo is required
- name: Checkout Repository
uses: actions/checkout@v2
- name: Deploy to Caprover
uses: JasirZaeem/caprover-deploy@v1.2
with:
token: ${{secrets.GITHUB_TOKEN}}
server: "https://captain.example.com"
password: ${{secrets.CAPROVER_PASSWORD}}
app: "application"220 smtp.example.com ESMTP Postfix HELO client.example.com 250 smtp.example.com MAIL FROM: <me@mydomain.com> 250 Ok RCPT TO: <hi@zaeem.dev> 250 Ok DATA 354 End data with <CR><LF>.<CR><LF> From: "Me" <me@mydomain.com> To: "Jasir" <hi@zaeem.dev> Date: $Tue, 16 Sep 2025 17:17:43 GMT Subject: Complaint Mail Hi Jasir,Your site gave me a virus. I am very upset.
Yours truly,
Me
.
250 Ok: queued as 12345
QUIT
221 Bye
You can reach me at mailto:hi@zaeem.dev