Skip to content

Check base image update #42

Check base image update

Check base image update #42

name: Check base image update
on:
schedule:
- cron: "0 1 * * *"
env:
image: clowa/powershell-core:latest
base-image: library/ubuntu:22.04
jobs:
check-base-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check if update available
id: check
uses: clowa/docker-image-update-checker@342608bb9829d85eeeeb292e78115184b5a6657d
# Switch back to official lucacome/docker-image-update-checker after PR is merged
with:
base-image: ${{ env.base-image }}
image: ${{ env.image }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
env:
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}
- if: steps.check.outputs.needs-updating == 'true'
name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
event-type: base-image-update
# Have to use custom PAT, because commits created with GITHUB_TOKEN will not trigger CI
# See: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
token: ${{ secrets.REPO_SCOPED_TOKEN }}
- if: steps.check.outputs.needs-updating == 'true'
name: Send telegram notification
uses: appleboy/telegram-action@v0.1.1
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
message: |
🐳 Base image ${{ env.base-image }} of ${{ env.image }} has been updated.
⚙️ Image rebuild is triggered.
📚 Repository: [ ${{ github.repository }} ](https://github.com/${{ github.repository }})