init
This commit is contained in:
commit
3f877cbb27
2 changed files with 59 additions and 0 deletions
55
.forgejo/workflows/package-check.yml
Normal file
55
.forgejo/workflows/package-check.yml
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
name: Alpine Package Auto-Rebuild
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 1 * * *' # Daily at 1:00 AM UTC
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: alpine-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Check for latest package version
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
PACKAGE="curl"
|
||||||
|
LATEST=$(apk policy $PACKAGE | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+[_a-zA-Z0-9.-]*' | head -n1 || echo "unknown")
|
||||||
|
echo "latest_version=$LATEST" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Compare with last known version
|
||||||
|
id: compare
|
||||||
|
run: |
|
||||||
|
FILE=".last_version"
|
||||||
|
[ -f "$FILE" ] && LAST=$(cat "$FILE") || LAST="none"
|
||||||
|
echo "Last known version: $LAST"
|
||||||
|
if [ "$LAST" != "${{ steps.check.outputs.latest_version }}" ]; then
|
||||||
|
echo "update=true" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "update=false" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Install Docker
|
||||||
|
if: steps.compare.outputs.update == 'true'
|
||||||
|
run: |
|
||||||
|
apk add --no-cache docker bash
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
if: steps.compare.outputs.update == 'true'
|
||||||
|
run: |
|
||||||
|
docker build -t melody/docker-test:latest .
|
||||||
|
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login git.shork.ch -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
||||||
|
docker push git.shork.ch/melody/docker-test:latest
|
||||||
|
echo "${{ steps.check.outputs.latest_version }}" > .last_version
|
||||||
|
|
||||||
|
- name: Commit updated version file
|
||||||
|
if: steps.compare.outputs.update == 'true'
|
||||||
|
run: |
|
||||||
|
git config user.name "forgejo-runner"
|
||||||
|
git config user.email "runner@forgejo.local"
|
||||||
|
git add .last_version
|
||||||
|
git commit -m "Update tracked version to ${{ steps.check.outputs.latest_version }}"
|
||||||
|
git push
|
||||||
|
|
4
Dockerfile
Normal file
4
Dockerfile
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
FROM alpine:latest
|
||||||
|
RUN apk add --no-cache curl
|
||||||
|
CMD ["curl", "--version"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue