Skip to content

Commit 65659e2

Browse files
authored
Merge pull request #1137 from Dokploy/feat/github-runners
Feat/GitHub runners
2 parents 30d20bd + 4b6f910 commit 65659e2

File tree

72 files changed

+18984
-364
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+18984
-364
lines changed

.circleci/config.yml

Lines changed: 0 additions & 119 deletions
This file was deleted.

.github/workflows/dokploy.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Dokploy Docker Build
2+
3+
on:
4+
push:
5+
branches: [main, canary, feat/github-runners]
6+
7+
env:
8+
IMAGE_NAME: dokploy/dokploy
9+
10+
jobs:
11+
docker-amd:
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v3
19+
20+
- name: Login to Docker Hub
21+
uses: docker/login-action@v3
22+
with:
23+
username: ${{ secrets.DOCKERHUB_USERNAME }}
24+
password: ${{ secrets.DOCKERHUB_TOKEN }}
25+
26+
- name: Set tag and version
27+
id: meta
28+
run: |
29+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
30+
TAG="latest"
31+
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
32+
elif [ "${{ github.ref }}" = "refs/heads/canary" ]; then
33+
TAG="canary"
34+
else
35+
TAG="feature"
36+
fi
37+
echo "tags=${IMAGE_NAME}:${TAG}-amd64" >> $GITHUB_OUTPUT
38+
39+
- name: Prepare env file
40+
run: |
41+
cp apps/dokploy/.env.production.example .env.production
42+
cp apps/dokploy/.env.production.example apps/dokploy/.env.production
43+
44+
- name: Build and push
45+
uses: docker/build-push-action@v5
46+
with:
47+
context: .
48+
platforms: linux/amd64
49+
push: true
50+
tags: ${{ steps.meta.outputs.tags }}
51+
docker-arm:
52+
runs-on: ubuntu-24.04-arm
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v4
56+
57+
- name: Set up Docker Buildx
58+
uses: docker/setup-buildx-action@v3
59+
60+
- name: Login to Docker Hub
61+
uses: docker/login-action@v3
62+
with:
63+
username: ${{ secrets.DOCKERHUB_USERNAME }}
64+
password: ${{ secrets.DOCKERHUB_TOKEN }}
65+
66+
- name: Set tag and version
67+
id: meta
68+
run: |
69+
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
70+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
71+
TAG="latest"
72+
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
73+
elif [ "${{ github.ref }}" = "refs/heads/canary" ]; then
74+
TAG="canary"
75+
else
76+
TAG="feature"
77+
fi
78+
echo "tags=${IMAGE_NAME}:${TAG}-arm64" >> $GITHUB_OUTPUT
79+
80+
- name: Prepare env file
81+
run: |
82+
cp apps/dokploy/.env.production.example .env.production
83+
cp apps/dokploy/.env.production.example apps/dokploy/.env.production
84+
85+
- name: Build and push
86+
uses: docker/build-push-action@v5
87+
with:
88+
context: .
89+
platforms: linux/arm64
90+
push: true
91+
tags: ${{ steps.meta.outputs.tags }}
92+
93+
combine-manifests:
94+
needs: [docker-amd, docker-arm]
95+
runs-on: ubuntu-latest
96+
steps:
97+
- name: Checkout
98+
uses: actions/checkout@v4
99+
100+
- name: Set up Docker Buildx
101+
uses: docker/setup-buildx-action@v3
102+
103+
- name: Login to Docker Hub
104+
uses: docker/login-action@v3
105+
with:
106+
username: ${{ secrets.DOCKERHUB_USERNAME }}
107+
password: ${{ secrets.DOCKERHUB_TOKEN }}
108+
109+
- name: Create and push manifests
110+
run: |
111+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
112+
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
113+
TAG="latest"
114+
115+
docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \
116+
${IMAGE_NAME}:${TAG}-amd64 \
117+
${IMAGE_NAME}:${TAG}-arm64
118+
119+
docker buildx imagetools create -t ${IMAGE_NAME}:${VERSION} \
120+
${IMAGE_NAME}:${TAG}-amd64 \
121+
${IMAGE_NAME}:${TAG}-arm64
122+
123+
elif [ "${{ github.ref }}" = "refs/heads/canary" ]; then
124+
TAG="canary"
125+
docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \
126+
${IMAGE_NAME}:${TAG}-amd64 \
127+
${IMAGE_NAME}:${TAG}-arm64
128+
129+
else
130+
TAG="feature"
131+
docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \
132+
${IMAGE_NAME}:${TAG}-amd64 \
133+
${IMAGE_NAME}:${TAG}-arm64
134+
fi
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import { extractCommitMessage } from "@/pages/api/deploy/[refreshToken]";
2+
import { describe, expect, it } from "vitest";
3+
4+
describe("GitHub Webhook Skip CI", () => {
5+
const mockGithubHeaders = {
6+
"x-github-event": "push",
7+
};
8+
9+
const createMockBody = (message: string) => ({
10+
head_commit: {
11+
message,
12+
},
13+
});
14+
15+
const skipKeywords = [
16+
"[skip ci]",
17+
"[ci skip]",
18+
"[no ci]",
19+
"[skip actions]",
20+
"[actions skip]",
21+
];
22+
23+
it("should detect skip keywords in commit message", () => {
24+
for (const keyword of skipKeywords) {
25+
const message = `feat: add new feature ${keyword}`;
26+
const commitMessage = extractCommitMessage(
27+
mockGithubHeaders,
28+
createMockBody(message),
29+
);
30+
expect(commitMessage.includes(keyword)).toBe(true);
31+
}
32+
});
33+
34+
it("should not detect skip keywords in normal commit message", () => {
35+
const message = "feat: add new feature";
36+
const commitMessage = extractCommitMessage(
37+
mockGithubHeaders,
38+
createMockBody(message),
39+
);
40+
for (const keyword of skipKeywords) {
41+
expect(commitMessage.includes(keyword)).toBe(false);
42+
}
43+
});
44+
45+
it("should handle different webhook sources", () => {
46+
// GitHub
47+
expect(
48+
extractCommitMessage(
49+
{ "x-github-event": "push" },
50+
{ head_commit: { message: "[skip ci] test" } },
51+
),
52+
).toBe("[skip ci] test");
53+
54+
// GitLab
55+
expect(
56+
extractCommitMessage(
57+
{ "x-gitlab-event": "push" },
58+
{ commits: [{ message: "[skip ci] test" }] },
59+
),
60+
).toBe("[skip ci] test");
61+
62+
// Bitbucket
63+
expect(
64+
extractCommitMessage(
65+
{ "x-event-key": "repo:push" },
66+
{
67+
push: {
68+
changes: [{ new: { target: { message: "[skip ci] test" } } }],
69+
},
70+
},
71+
),
72+
).toBe("[skip ci] test");
73+
74+
// Gitea
75+
expect(
76+
extractCommitMessage(
77+
{ "x-gitea-event": "push" },
78+
{ commits: [{ message: "[skip ci] test" }] },
79+
),
80+
).toBe("[skip ci] test");
81+
});
82+
83+
it("should handle missing commit message", () => {
84+
expect(extractCommitMessage(mockGithubHeaders, {})).toBe("NEW COMMIT");
85+
expect(extractCommitMessage({ "x-gitlab-event": "push" }, {})).toBe(
86+
"NEW COMMIT",
87+
);
88+
expect(
89+
extractCommitMessage(
90+
{ "x-event-key": "repo:push" },
91+
{ push: { changes: [] } },
92+
),
93+
).toBe("NEW COMMIT");
94+
expect(extractCommitMessage({ "x-gitea-event": "push" }, {})).toBe(
95+
"NEW COMMIT",
96+
);
97+
});
98+
});

apps/dokploy/__test__/traefik/server/update-server-config.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import {
1414
import { beforeEach, expect, test, vi } from "vitest";
1515

1616
const baseAdmin: Admin = {
17+
cleanupCacheApplications: false,
18+
cleanupCacheOnCompose: false,
19+
cleanupCacheOnPreviews: false,
1720
createdAt: "",
1821
authId: "",
1922
adminId: "string",

apps/dokploy/__test__/vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default defineConfig({
1313
NODE: "test",
1414
},
1515
},
16+
plugins: [tsconfigPaths()],
1617
resolve: {
1718
alias: {
1819
"@dokploy/server": path.resolve(

apps/dokploy/components/dashboard/database/backups/show-backups.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ export const ShowBackups = ({ id, type }: Props) => {
7575
{data?.length === 0 ? (
7676
<div className="flex flex-col items-center gap-3">
7777
<DatabaseBackup className="size-8 text-muted-foreground" />
78-
<span className="text-base text-muted-foreground">
78+
<span className="text-base text-muted-foreground text-center">
7979
To create a backup it is required to set at least 1 provider.
8080
Please, go to{" "}
8181
<Link
82-
href="/dashboard/settings/server"
82+
href="/dashboard/settings/destinations"
8383
className="text-foreground"
8484
>
85-
Settings
85+
S3 Destinations
8686
</Link>{" "}
8787
to do so.
8888
</span>

apps/dokploy/components/dashboard/docker/show/show-containers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const ShowContainers = ({ serverId }: Props) => {
8080

8181
return (
8282
<div className="w-full">
83-
<Card className="h-full bg-sidebar p-2.5 rounded-xl max-w-8xl mx-auto">
83+
<Card className="h-full bg-sidebar p-2.5 rounded-xl">
8484
<div className="rounded-xl bg-background shadow-md ">
8585
<CardHeader className="">
8686
<CardTitle className="text-xl flex flex-row gap-2">

0 commit comments

Comments
 (0)