on: push: schedule: - cron: '0 23 * * *' 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/giggio/docker-image-update-checker@v2 with: base-image: codeberg.org/forgejo/forgejo:${{ env.FORGEJO_VERSION }} image: ${{ env.REPO }}:latest - name: Check result if: env.SCHEDULED run: echo "Needs updating = ${{ steps.check.outputs.needs-updating }}" - name: Set up Docker Buildx if: env.PUSHED || ${{ steps.check.outputs.needs-updating == 'true' }} uses: docker/setup-buildx-action@v3 - name: Login to Docker registry if: env.PUSHED || ${{ steps.check.outputs.needs-updating == '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.needs-updating == '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.needs-updating == 'true' }} uses: https://github.com/appleboy/telegram-action@master with: to: "-1001915202306" token: ${{ secrets.TELEGRAM_TOKEN }} message: | Newest 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