Implement automatic build when upstream updates
Also tagging 1.xx versions now in addition to `latest`
This commit is contained in:
parent
e9842be6c2
commit
2fd09a8f4d
2 changed files with 34 additions and 6 deletions
|
@ -1,27 +1,54 @@
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 * * * *'
|
||||||
jobs:
|
jobs:
|
||||||
|
name: Build image
|
||||||
build_image:
|
build_image:
|
||||||
|
env:
|
||||||
|
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
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check if update available
|
||||||
|
if: env.SCHEDULED
|
||||||
|
id: check
|
||||||
|
uses: https://github.com/lucacome/docker-image-update-checker@v1
|
||||||
|
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
|
- name: Set up Docker Buildx
|
||||||
|
if: env.PUSHED || ${{ steps.check.outputs.needs-updating == 'true' }}
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Login to Docker registry (Forgejo)
|
- name: Login to Docker registry
|
||||||
|
if: env.PUSHED || ${{ steps.check.outputs.needs-updating == 'true' }}
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: git.korhonen.cc
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
|
if: env.PUSHED || ${{ steps.check.outputs.needs-updating == 'true' }}
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: git.korhonen.cc/functionalhacker/forgejo-asciidoc
|
build-args: FORGEJO_VERSION=${{ env.FORGEJO_VERSION }}
|
||||||
|
tags: |
|
||||||
|
${{ env.REPO }}:latest
|
||||||
|
${{ env.REPO }}:${{ env.FORGEJO_VERSION }}
|
||||||
- name: Notify in Telegram channel
|
- name: Notify in Telegram channel
|
||||||
|
if: env.PUSHED || ${{ steps.check.outputs.needs-updating == 'true' }}
|
||||||
uses: https://github.com/appleboy/telegram-action@master
|
uses: https://github.com/appleboy/telegram-action@master
|
||||||
with:
|
with:
|
||||||
to: "-1001915202306"
|
to: "-1001915202306"
|
||||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||||
message: |
|
message: |
|
||||||
Newest version of forgejo-asciidoc support has just been built. docker pull away!
|
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
|
See details: https://git.korhonen.cc/FunctionalHacker/-/packages/container/forgejo-asciidoc/latest
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
FROM codeberg.org/forgejo/forgejo:1.21
|
ARG FORGEJO_VERSION
|
||||||
|
FROM codeberg.org/forgejo/forgejo:${FORGEJO_VERSION}
|
||||||
RUN apk --no-cache add asciidoctor ruby-rouge
|
RUN apk --no-cache add asciidoctor ruby-rouge
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue