fix docker
All checks were successful
release / Release (push) Successful in 2m34s

This commit is contained in:
2026-02-27 17:07:38 +09:00
parent 31114ecd74
commit cab700e6fb
2 changed files with 34 additions and 35 deletions

View File

@@ -1,4 +1,4 @@
name: build and push image
name: release
on:
schedule:
@@ -7,10 +7,10 @@ on:
env:
TAG: latest
IMAGE_ID: aios
IMAGE_NAME: ${{ gitea.repository }}
APP_TOKEN: ${{ secrets.APP_TOKEN }}
REGISTRY: localhost:8088
GITEA_URL: https://git.syui.ai
jobs:
release:
@@ -20,10 +20,25 @@ jobs:
image: ghcr.io/syui/aios
options: --privileged
steps:
- name: Pull and re-tag image
- name: Pull and push to local registry
run: |
pacman -Sy --noconfirm docker
docker pull ghcr.io/syui/aios
docker tag ghcr.io/syui/aios ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
echo "${{ env.APP_TOKEN }}" | docker login ${{ env.REGISTRY }} -u syui --password-stdin
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
- name: Create release with tarball
run: |
curl -s -o aios.tar.gz -L "https://github.com/syui/aios/releases/download/latest/aios.tar.gz"
existing=$(curl -s -H "Authorization: token ${{ env.APP_TOKEN }}" "${{ env.GITEA_URL }}/api/v1/repos/${{ env.IMAGE_NAME }}/releases/tags/${{ env.TAG }}" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
if [ -n "$existing" ]; then
curl -s -X DELETE -H "Authorization: token ${{ env.APP_TOKEN }}" "${{ env.GITEA_URL }}/api/v1/repos/${{ env.IMAGE_NAME }}/releases/$existing"
fi
git tag -f ${{ env.TAG }} 2>/dev/null || true
release_id=$(curl -s -X POST -H "Authorization: token ${{ env.APP_TOKEN }}" -H "Content-Type: application/json" \
-d '{"tag_name":"${{ env.TAG }}","name":"${{ env.TAG }}","body":"build '$(date +%Y.%m.%d)'"}' \
"${{ env.GITEA_URL }}/api/v1/repos/${{ env.IMAGE_NAME }}/releases" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
curl -s -X POST -H "Authorization: token ${{ env.APP_TOKEN }}" \
-F "attachment=@aios.tar.gz" \
"${{ env.GITEA_URL }}/api/v1/repos/${{ env.IMAGE_NAME }}/releases/$release_id/assets"