forgejo-asciidoc/.forgejo/workflows/build.yaml
Marko Korhonen c7f57d578d
Some checks failed
/ Build image (push) Failing after 4s
Fix cron and codeberg registry not working
2024-02-25 00:25:24 +02:00

55 lines
2.1 KiB
YAML

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