Skip to content

Commit 0f131d3

Browse files
authored
Merge pull request #1136 from Dokploy/feat/github-runners
refactor: add github docker
2 parents f9b4f00 + 4b6f910 commit 0f131d3

File tree

2 files changed

+134
-119
lines changed

2 files changed

+134
-119
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

0 commit comments

Comments
 (0)