Check base image update #387
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check base image update | |
on: | |
workflow_dispatch: | |
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@v4 | |
- 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 | |
env: | |
DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }} | |
- if: steps.check.outputs.needs-updating == 'true' | |
name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v3 | |
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 }}) |