diff --git a/.gitea/workflows/lastreleased.yaml b/.gitea/workflows/lastreleased.yaml index c8c34e4..01fd1c1 100644 --- a/.gitea/workflows/lastreleased.yaml +++ b/.gitea/workflows/lastreleased.yaml @@ -18,25 +18,39 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Get the latest tag id: get_last_tag run: echo "LAST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT + - name: Checkout latest version run: git checkout ${{ steps.get_last_tag.outputs.LAST_TAG }} - - name: Set up docker buildx - uses: docker/setup-buildx-action@v3 - with: - driver-opts: | - network=giteanet + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Check if update available + id: checkupdate + uses: lucacome/docker-image-update-checker@v2.0.0 + with: + base-image: php:8.3-apache + image: zeguigui/open-report-analyzer:latest + + - name: Set up docker buildx + uses: docker/setup-buildx-action@v3 + with: + driver-opts: | + network=giteanet + if: steps.checkupdate.outputs.needs-updating == 'true' + - name: Build and push version uses: docker/build-push-action@v5 env: ACTIONS_RUNTIME_TOKEN: '' with: push: true - tags: zeguigui/open-report-analyzer:${{ steps.get_last_tag.outputs.LAST_TAG }},zeguigui/open-report-analyzer:latest \ No newline at end of file + tags: zeguigui/open-report-analyzer:${{ steps.get_last_tag.outputs.LAST_TAG }},zeguigui/open-report-analyzer:latest + if: steps.checkupdate.outputs.needs-updating == 'true'