-
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add logic to allow user check new version * update action
- Loading branch information
Showing
5 changed files
with
45 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,8 +72,24 @@ jobs: | |
if: contains(github.ref, '/heads/master') || contains(github.ref, '/tags/v') | ||
run: | | ||
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }} | ||
- name: Update tag | ||
- | ||
name: Update APP VERSION | ||
if: contains(github.ref, '/tags/v') | ||
run: | | ||
VERSION=${GITHUB_REF#refs/tags/v} | ||
echo $VERSION > APP_VERSION | ||
- | ||
name: Commit changes | ||
if: contains(github.ref, '/tags/v') | ||
uses: EndBug/add-and-commit@v7 | ||
with: | ||
author_name: junv-repo-bot | ||
author_email: [email protected] | ||
message: 'Update version' | ||
add: 'APP_VERSION' | ||
push: true | ||
- | ||
name: Update tag | ||
if: contains(github.ref, '/tags/v') | ||
env: | ||
API_KEY: ${{ secrets.BadgeAPIKey }} | ||
|
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 @@ | ||
4.8.2.2 |
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,24 @@ | ||
#! /bin/bash -u | ||
sleep 5 | ||
|
||
set -e | ||
APP_VERSION=$(cat APP_VERSION) | ||
set +e | ||
while true; do | ||
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Checking for new version against ${APP_VERSION} ..." | ||
newer_version=$(curl -s https://badges.toozhao.com/val/aria2-ui-docker?version=${APP_VERSION}) | ||
if [ -z ${newer_version} ]; then | ||
echo "[WARN] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Failed to check new version." | ||
sleep 86400 | ||
continue | ||
fi | ||
|
||
if [ ${newer_version} != ${APP_VERSION} ]; then | ||
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Found newer Docker image version wahyd4/aria2-ui:${newer_version}, please consider to upgrade by using docker pull command to have better user experience." | ||
# check new version daily | ||
sleep 86400 | ||
continue | ||
fi | ||
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Good job, you are using the latest version docker image" | ||
sleep 86400 | ||
done |