Skip to content

Commit d84a22f

Browse files
committed
feat: add monitoring arm-amd version
1 parent 1661022 commit d84a22f

File tree

2 files changed

+117
-23
lines changed

2 files changed

+117
-23
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,3 @@ jobs:
7777
tags: |
7878
siumauricio/server:${{ github.ref_name == 'main' && 'latest' || 'canary' }}
7979
platforms: linux/amd64
80-
81-
build-and-push-monitoring-image:
82-
runs-on: ubuntu-latest
83-
84-
steps:
85-
- name: Checkout repository
86-
uses: actions/checkout@v3
87-
88-
- name: Log in to Docker Hub
89-
uses: docker/login-action@v2
90-
with:
91-
username: ${{ secrets.DOCKERHUB_USERNAME }}
92-
password: ${{ secrets.DOCKERHUB_TOKEN }}
93-
94-
- name: Build and push Docker image
95-
uses: docker/build-push-action@v4
96-
with:
97-
context: .
98-
file: ./Dockerfile.monitoring
99-
push: true
100-
tags: |
101-
dokploy/monitoring:${{ github.ref_name == 'main' && 'latest' || 'canary' }}
102-
platforms: linux/amd64

.github/workflows/monitoring.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Dokploy Monitoring Build
2+
3+
on:
4+
push:
5+
branches: [main, canary]
6+
7+
env:
8+
IMAGE_NAME: dokploy/monitoring
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
27+
id: meta
28+
run: |
29+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
30+
TAG="latest"
31+
elif [ "${{ github.ref }}" = "refs/heads/canary" ]; then
32+
TAG="canary"
33+
else
34+
TAG="feature"
35+
fi
36+
echo "tags=${IMAGE_NAME}:${TAG}-amd64" >> $GITHUB_OUTPUT
37+
38+
- name: Build and push
39+
uses: docker/build-push-action@v5
40+
with:
41+
context: .
42+
platforms: linux/amd64
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}
45+
docker-arm:
46+
runs-on: ubuntu-24.04-arm
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@v3
53+
54+
- name: Login to Docker Hub
55+
uses: docker/login-action@v3
56+
with:
57+
username: ${{ secrets.DOCKERHUB_USERNAME }}
58+
password: ${{ secrets.DOCKERHUB_TOKEN }}
59+
60+
- name: Set tag and version
61+
id: meta
62+
run: |
63+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
64+
TAG="latest"
65+
elif [ "${{ github.ref }}" = "refs/heads/canary" ]; then
66+
TAG="canary"
67+
else
68+
TAG="feature"
69+
fi
70+
echo "tags=${IMAGE_NAME}:${TAG}-arm64" >> $GITHUB_OUTPUT
71+
72+
- name: Build and push
73+
uses: docker/build-push-action@v5
74+
with:
75+
context: .
76+
platforms: linux/arm64
77+
push: true
78+
tags: ${{ steps.meta.outputs.tags }}
79+
80+
combine-manifests:
81+
needs: [docker-amd, docker-arm]
82+
runs-on: ubuntu-latest
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@v4
86+
87+
- name: Set up Docker Buildx
88+
uses: docker/setup-buildx-action@v3
89+
90+
- name: Login to Docker Hub
91+
uses: docker/login-action@v3
92+
with:
93+
username: ${{ secrets.DOCKERHUB_USERNAME }}
94+
password: ${{ secrets.DOCKERHUB_TOKEN }}
95+
96+
- name: Create and push manifests
97+
run: |
98+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
99+
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
100+
TAG="latest"
101+
102+
docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \
103+
${IMAGE_NAME}:${TAG}-amd64 \
104+
${IMAGE_NAME}:${TAG}-arm64
105+
106+
elif [ "${{ github.ref }}" = "refs/heads/canary" ]; then
107+
TAG="canary"
108+
docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \
109+
${IMAGE_NAME}:${TAG}-amd64 \
110+
${IMAGE_NAME}:${TAG}-arm64
111+
112+
else
113+
TAG="feature"
114+
docker buildx imagetools create -t ${IMAGE_NAME}:${TAG} \
115+
${IMAGE_NAME}:${TAG}-amd64 \
116+
${IMAGE_NAME}:${TAG}-arm64
117+
fi

0 commit comments

Comments
 (0)