Skip to content

Commit 9298d6c

Browse files
authored
Merge pull request #1144 from Dokploy/canary
🚀 Release v0.17.3
2 parents 30d20bd + 23df3fb commit 9298d6c

File tree

70 files changed

+10437
-365
lines changed

Some content is hidden

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

70 files changed

+10437
-365
lines changed

.circleci/config.yml

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

.github/workflows/create-pr.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Auto PR to main when version changes
2+
3+
on:
4+
push:
5+
branches:
6+
- canary
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
create-pr:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Get version from package.json
22+
id: package_version
23+
run: echo "VERSION=$(jq -r .version ./apps/dokploy/package.json)" >> $GITHUB_ENV
24+
25+
- name: Get latest GitHub tag
26+
id: latest_tag
27+
run: |
28+
LATEST_TAG=$(git ls-remote --tags origin | awk -F'/' '{print $3}' | sort -V | tail -n1)
29+
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
30+
echo $LATEST_TAG
31+
- name: Compare versions
32+
id: compare_versions
33+
run: |
34+
if [ "${{ env.VERSION }}" != "${{ env.LATEST_TAG }}" ]; then
35+
VERSION_CHANGED="true"
36+
else
37+
VERSION_CHANGED="false"
38+
fi
39+
echo "VERSION_CHANGED=$VERSION_CHANGED" >> $GITHUB_ENV
40+
echo "Comparing versions:"
41+
echo "Current version: ${{ env.VERSION }}"
42+
echo "Latest tag: ${{ env.LATEST_TAG }}"
43+
echo "Version changed: $VERSION_CHANGED"
44+
- name: Check if a PR already exists
45+
id: check_pr
46+
run: |
47+
PR_EXISTS=$(gh pr list --state open --base main --head canary --json number --jq '. | length')
48+
echo "PR_EXISTS=$PR_EXISTS" >> $GITHUB_ENV
49+
env:
50+
GH_TOKEN: ${{ secrets.GH_PAT }}
51+
52+
- name: Create Pull Request
53+
if: env.VERSION_CHANGED == 'true' && env.PR_EXISTS == '0'
54+
run: |
55+
git config --global user.name "github-actions[bot]"
56+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
57+
58+
git fetch origin main
59+
git checkout canary
60+
git push origin canary
61+
62+
gh pr create \
63+
--title "🚀 Release ${{ env.VERSION }}" \
64+
--body '
65+
This PR promotes changes from `canary` to `main` for version ${{ env.VERSION }}.
66+
67+
### 🔍 Changes Include:
68+
- Version bump to ${{ env.VERSION }}
69+
- All changes from canary branch
70+
71+
### ✅ Pre-merge Checklist:
72+
- [ ] All tests passing
73+
- [ ] Documentation updated
74+
- [ ] Docker images built and tested
75+
76+
> 🤖 This PR was automatically generated by [GitHub Actions](https://github.com/actions)' \
77+
--base main \
78+
--head canary \
79+
--label "release" --label "automated pr" || true \
80+
--reviewer siumauricio \
81+
--assignee siumauricio
82+
env:
83+
GH_TOKEN: ${{ github.token }}

.github/workflows/dokploy.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
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
135+
136+
generate-release:
137+
needs: [combine-manifests]
138+
if: github.ref == 'refs/heads/main'
139+
runs-on: ubuntu-latest
140+
steps:
141+
- name: Checkout
142+
uses: actions/checkout@v4
143+
with:
144+
fetch-depth: 0
145+
146+
- name: Get version
147+
id: get_version
148+
run: |
149+
VERSION=$(node -p "require('./apps/dokploy/package.json').version")
150+
echo "version=$VERSION" >> $GITHUB_OUTPUT
151+
152+
- name: Create Release
153+
uses: softprops/action-gh-release@v2
154+
with:
155+
tag_name: v${{ steps.get_version.outputs.version }}
156+
name: Release v${{ steps.get_version.outputs.version }}
157+
generate_release_notes: true
158+
draft: false
159+
prerelease: false
160+
env:
161+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)