3 Commits

Author SHA1 Message Date
Cedric 0876eecf50 ci: improve dev pipeline with Dokploy webhook and Docker layer caching 2026-05-10 21:27:28 +02:00
Cedric 5549691d50 ci: test pipeline 2026-05-10 21:24:18 +02:00
Cedric 46c8df45d6 ci: test pipeline 2026-05-10 21:24:10 +02:00
+30 -28
View File
@@ -12,43 +12,45 @@ jobs:
steps: steps:
# 1. Checkout the code # 1. Checkout the code
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v4
# 2. Set up Java and Maven # 2. Set up Java and Maven (includes Maven, no separate install needed)
- name: Set up JDK (Eclipse Temurin) - name: Set up JDK (Eclipse Temurin)
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: "temurin" distribution: "temurin"
java-version: "17" java-version: "17"
cache: maven cache: maven
# 3. Verify Maven installation # 3. Build the Spring Boot application
- name: Install Maven
run: |
sudo apt-get update
sudo apt-get install -y maven
mvn -version
# 4. Build the Spring Boot application
- name: Build Spring Boot Application - name: Build Spring Boot Application
run: | run: mvn clean package -DskipTests
mvn clean package -DskipTests
# 5. Set up Docker # 4. Set up Docker Buildx (enables layer caching)
- name: Set up Docker - name: Set up Docker Buildx
run: | uses: docker/setup-buildx-action@v3
docker --version
# 6. Build the Docker image # 5. Docker login
- name: Build and Package Docker Image
run: |
docker build -t tea.zendric.de/cedric/xpensely-server:latest .
# 7. Docker login
- name: Login to Docker Registry - name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: tea.zendric.de
username: ${{ secrets.TEAUSER }}
password: ${{ secrets.TEAPASSWORD }}
# 6. Build and push Docker image with layer caching
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: tea.zendric.de/cedric/xpensely-server:latest
cache-from: type=registry,ref=tea.zendric.de/cedric/xpensely-server:buildcache
cache-to: type=registry,ref=tea.zendric.de/cedric/xpensely-server:buildcache,mode=max
# 7. Trigger Dokploy to redeploy the dev server automatically
- name: Trigger Dokploy Redeploy
run: | run: |
echo "${{ secrets.TEAPASSWORD }}" | docker login tea.zendric.de -u ${{ secrets.TEAUSER }} --password-stdin curl -X POST "${{ secrets.DOKPLOY_WEBHOOK_URL }}" \
# 8. Push Docker image -H "Authorization: Bearer ${{ secrets.DOKPLOY_TOKEN }}" \
- name: Push the Docker Image to registry --fail
run: |
docker push tea.zendric.de/cedric/xpensely-server:latest