⬆️ Update Duplicati to v2.4.0.100 #130
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Builder | |
| env: | |
| BUILD_ARGS: "--test" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "duplicati/**" | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "duplicati/**" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Build ${{ matrix.arch }} duplicati add-on | |
| strategy: | |
| matrix: | |
| arch: ["amd64", "aarch64"] | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6.0.2 | |
| - name: Get information | |
| id: info | |
| uses: home-assistant/actions/helpers/info@master | |
| with: | |
| path: "./duplicati" | |
| - name: Check if add-on should be built | |
| id: check | |
| run: | | |
| if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then | |
| echo "build_arch=true" >> $GITHUB_OUTPUT | |
| echo "image=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)" >> $GITHUB_OUTPUT | |
| if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then | |
| echo "BUILD_ARGS=" >> $GITHUB_ENV; | |
| fi | |
| else | |
| echo "${{ matrix.arch }} is not a valid arch for duplicati, skipping build"; | |
| echo "build_arch=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Login to GitHub Container Registry | |
| if: env.BUILD_ARGS != '--test' | |
| uses: docker/login-action@v4.1.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build duplicati add-on | |
| if: steps.check.outputs.build_arch == 'true' | |
| uses: home-assistant/builder@2026.03.2 | |
| with: | |
| args: | | |
| ${{ env.BUILD_ARGS }} \ | |
| --${{ matrix.arch }} \ | |
| --target /data/duplicati \ | |
| --image "${{ steps.check.outputs.image }}" \ | |
| --docker-hub "ghcr.io/${{ github.repository_owner }}" \ | |
| --addon | |
| test: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| name: Test container startup | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6.0.2 | |
| - name: Get build information | |
| id: info | |
| run: | | |
| BUILD_FROM=$(grep "amd64:" duplicati/build.yaml | head -1 | sed 's/.*: *"\(.*\)"/\1/') | |
| TEMPIO_VERSION=$(grep 'TEMPIO_VERSION:' duplicati/build.yaml | sed 's/.*: *"\(.*\)"/\1/') | |
| DUPLICATI_VERSION=$(grep 'DUPLICATI_VERSION:' duplicati/build.yaml | sed 's/.*: *"\(.*\)"/\1/') | |
| DUPLICATI_CHANNEL=$(grep 'DUPLICATI_CHANNEL:' duplicati/build.yaml | sed 's/.*: *"\(.*\)"/\1/') | |
| DUPLICATI_DATE=$(grep 'DUPLICATI_DATE:' duplicati/build.yaml | sed 's/.*: *"\(.*\)"/\1/') | |
| echo "build_from=${BUILD_FROM}" >> $GITHUB_OUTPUT | |
| echo "tempio=${TEMPIO_VERSION}" >> $GITHUB_OUTPUT | |
| echo "duplicati_version=${DUPLICATI_VERSION}" >> $GITHUB_OUTPUT | |
| echo "duplicati_channel=${DUPLICATI_CHANNEL}" >> $GITHUB_OUTPUT | |
| echo "duplicati_date=${DUPLICATI_DATE}" >> $GITHUB_OUTPUT | |
| - name: Build test image | |
| run: | | |
| docker build \ | |
| --build-arg "BUILD_FROM=${{ steps.info.outputs.build_from }}" \ | |
| --build-arg "BUILD_ARCH=amd64" \ | |
| --build-arg "TEMPIO_VERSION=${{ steps.info.outputs.tempio }}" \ | |
| --build-arg "DUPLICATI_VERSION=${{ steps.info.outputs.duplicati_version }}" \ | |
| --build-arg "DUPLICATI_CHANNEL=${{ steps.info.outputs.duplicati_channel }}" \ | |
| --build-arg "DUPLICATI_DATE=${{ steps.info.outputs.duplicati_date }}" \ | |
| -t duplicati-test:latest \ | |
| -f duplicati/Dockerfile \ | |
| duplicati/ | |
| - name: Start container | |
| run: | | |
| mkdir -p /tmp/test-data/duplicati | |
| docker run -d \ | |
| --name duplicati-test \ | |
| -p 8080:8080 \ | |
| -v /tmp/test-data:/data \ | |
| duplicati-test:latest | |
| - name: Wait for services and health check | |
| run: | | |
| echo "Waiting for nginx to start..." | |
| for i in $(seq 1 60); do | |
| if curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/ | grep -qE "200|301|302|307"; then | |
| echo "nginx is responding (attempt $i)" | |
| break | |
| fi | |
| if [ $i -eq 60 ]; then | |
| echo "Timeout waiting for nginx" | |
| docker logs duplicati-test | |
| exit 1 | |
| fi | |
| sleep 2 | |
| done | |
| # Wait for Duplicati API to be accessible through nginx | |
| # (Duplicati .NET server takes longer to start than nginx) | |
| echo "Waiting for Duplicati API..." | |
| for i in $(seq 1 60); do | |
| HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/api/v1/serverstate) | |
| if [[ "$HTTP_CODE" =~ ^(200|302|307|401|403)$ ]]; then | |
| echo "Duplicati API accessible (HTTP ${HTTP_CODE}, attempt $i)" | |
| break | |
| fi | |
| if [ $i -eq 60 ]; then | |
| echo "Timeout waiting for Duplicati API (last HTTP ${HTTP_CODE})" | |
| docker logs duplicati-test | |
| exit 1 | |
| fi | |
| sleep 2 | |
| done | |
| echo "All health checks passed" | |
| - name: Container logs on failure | |
| if: failure() | |
| run: docker logs duplicati-test 2>&1 || true | |
| - name: Cleanup | |
| if: always() | |
| run: docker rm -f duplicati-test || true |