Skip to content

Get latest alpine release #148

Get latest alpine release

Get latest alpine release #148

name: Get latest alpine release
on:
push:
#branches:
# - main
paths:
# Run when file is edited
- .github/workflows/get-latest-alpine-release.yml
schedule:
- cron: '0 9 * * *'
workflow_dispatch:
jobs:
get-alpine-release-date:
runs-on: ubuntu-latest
steps:
# Login to docker is not nessasary for lucacome/docker-image-update-checker@v1.2.1
# - name: Login to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Docker Image Update Checker
id: check
# uses: lucacome/docker-image-update-checker@v1.2.1
uses: clowa/docker-image-update-checker@342608bb9829d85eeeeb292e78115184b5a6657d
with:
base-image: library/alpine:latest
# The library is a keyword used by docker offical images and fixes https://github.com/lucacome/docker-image-update-checker/issues/31
image: zinen2/alpine-pigpiod:latest
# Platforms with variants removed due to issue https://github.com/lucacome/docker-image-update-checker/issues/27
platforms: linux/arm/v6,linux/arm/v7,linux/arm64
# platforms: linux/arm64
# env:
# DEBUG: true
push-alpine-release-date:
needs: get-alpine-release-date
if: needs.check.outputs.needs-updating == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
# Use PAT so allow this action to trigger a new action
token: ${{ secrets.PAT }}
- name: Check result
run: |
echo "Needs updating: ${{ steps.check.outputs.needs-updating }}"
CURRENT_TIME=$( date )
echo Checked time $CURRENT_TIME
# Save the current checked time to a file in folder(folder must be there before)
echo Checked time $CURRENT_TIME > release-versions/alpine-new-release.txt
cat release-versions/alpine-new-release.txt
- name: Push changes
# This needs actions/checkout to be able push to repo
run: |
git config user.name "bot_${{ github.event_name }}"
git config user.email "bot_${{ github.event_name }}@users.noreply.github.com"
# Add all files to commit in current and sub folders
git add .
# Check if something changed and then commit
git diff --quiet HEAD || git commit -m "Auto. A ${{ github.event_name }} added this"
git push