on: push: schedule: - cron: '0 0 * * *' jobs: build_image: name: Build image env: FORGEJO_VERSION: 1.21 SCHEDULED: ${{ github.event_name == 'schedule' }} PUSHED: ${{ github.event_name == 'push' }} REGISTRY: git.korhonen.cc REPO: ${{ env.REGISTRY }}/functionalhacker/forgejo-asciidoc runs-on: docker steps: - name: Check if update available if: env.SCHEDULED id: check uses: https://github.com/ClementTsang/docker-check-base-image-diff@v0.0.2 with: base-image: docker://codeberg.org/forgejo/forgejo:${{ env.FORGEJO_VERSION }} derived-image: docker://${{ env.REPO }}:latest - name: Check result if: env.SCHEDULED run: echo "Needs updating = ${{ steps.check.outputs.differs }}" - name: Set up Docker Buildx if: env.PUSHED || ${{ steps.check.outputs.differs == true }} uses: docker/setup-buildx-action@v3 - name: Login to Docker registry if: env.PUSHED || ${{ steps.check.outputs.differs == true }} uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PASSWORD }} - name: Build and push image if: env.PUSHED || ${{ steps.check.outputs.differs == true }} uses: docker/build-push-action@v5 with: push: true build-args: FORGEJO_VERSION=${{ env.FORGEJO_VERSION }} tags: | ${{ env.REPO }}:latest ${{ env.REPO }}:${{ env.FORGEJO_VERSION }} - name: Notify in Telegram channel if: env.PUSHED || ${{ steps.check.outputs.differs == true }} uses: https://github.com/appleboy/telegram-action@master with: to: "-1001915202306" token: ${{ secrets.TELEGRAM_TOKEN }} message: | New version v${{ env.FORGEJO_VERSION }} of forgejo-asciidoc support has just been built. docker pull away! See details: https://git.korhonen.cc/FunctionalHacker/-/packages/container/forgejo-asciidoc/latest