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 c664ba8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 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,16 @@ jobs:
run: |
TAG_MINIMAL=$(cat ./TAG_MINIMAL)
TAG=$(cat ./TAG)
docker image rm quay.io/cybozu/ubuntu-minimal:${TAG_MINIMAL}-new
docker buildx build --platform linux/amd64 -t quay.io/cybozu/ubuntu-minimal:${TAG_MINIMAL}-new --load --build-arg TAG_MINIMAL=$TAG_MINIMAL ubuntu-minimal
docker images
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 $img:${{ matrix.ubuntu-version }}-new --load --build-arg TAG_MINIMAL=${TAG_MINIMAL}-new --build-arg TAG=$TAG ./$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
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 +74,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 $img:${{ matrix.ubuntu-version }}-new
done
- name: Create PR
if: env.NEED_UPDATE == '1'
shell: bash -xe {0}
Expand Down

0 comments on commit c664ba8

Please sign in to comment.