Skip to content

Commit

Permalink
Fix update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zoetrope committed Aug 4, 2023
1 parent 4d2e9fc commit 38f3131
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: update
on:
schedule:
- cron: '0 22 * * 0-4'
pull_request:
jobs:
update:
name: Update images
Expand Down Expand Up @@ -53,13 +54,15 @@ jobs:
run: |
TAG_MINIMAL=$(cat ./TAG_MINIMAL)
TAG=$(cat ./TAG)
docker buildx use default
docker buildx build -t quay.io/cybozu/ubuntu-minimal:${TAG_MINIMAL}-new --load --build-arg TAG_MINIMAL=$TAG_MINIMAL ubuntu-minimal
for img in ubuntu ubuntu-debug ubuntu-dev; do
docker pull ghcr.io/cybozu/$img:$TAG
docker buildx build --platform linux/amd64 -t $img:${{ matrix.ubuntu-version }}-new --load --build-arg TAG_MINIMAL=$TAG_MINIMAL --build-arg TAG=$TAG ./$img/
docker buildx build --platform linux/amd64 -t quay.io/cybozu/$img:${{ matrix.ubuntu-version }}-new --load --no-cache=false --build-arg TAG_MINIMAL=${TAG_MINIMAL}-new --build-arg TAG=${{ matrix.ubuntu-version }}-new ./$img/
docker run --rm ghcr.io/cybozu/$img:$TAG dpkg -l > $img-$TAG
docker run --rm $img:${{ matrix.ubuntu-version }}-new dpkg -l > $img-${{ matrix.ubuntu-version }}-new
docker image rm $img:${{ matrix.ubuntu-version }}-new
docker run --rm quay.io/cybozu/$img:${{ matrix.ubuntu-version }}-new dpkg -l > $img-${{ matrix.ubuntu-version }}-new
if ! diff -u $img-$TAG $img-${{ matrix.ubuntu-version }}-new; then
echo "- Update $img:${{ matrix.ubuntu-version }} packages" >> ./BODY
echo '```diff' >> ./BODY
Expand All @@ -70,6 +73,11 @@ jobs:
fi
fi
done
docker image rm quay.io/cybozu/ubuntu-minimal:${TAG_MINIMAL}-new
for img in ubuntu ubuntu-debug ubuntu-dev; do
docker image rm quay.io/cybozu/$img:${{ matrix.ubuntu-version }}-new
done
- name: Create PR
if: env.NEED_UPDATE == '1'
shell: bash -xe {0}
Expand Down

0 comments on commit 38f3131

Please sign in to comment.