-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
100 additions
and
51 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
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/[email protected] | ||
# - 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/[email protected] | ||
with: | ||
base-image: alpine:latest | ||
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 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Checked time Wed Mar 15 10:07:04 UTC 2023 |