Weekly images update #4
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
name: Weekly images update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 2 * * 0' | |
jobs: | |
update-image: | |
name: ${{ matrix.group }} | |
runs-on: [self-hosted, spread-enabled] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- group: ubuntu-24.04-64 | |
source: ubuntu-24.04-64-base | |
target: ubuntu-24.04-64 | |
cloud: google | |
- group: ubuntu-24.10-64 | |
source: ubuntu-24.10-64-base | |
target: ubuntu-24.10-64 | |
cloud: google | |
steps: | |
- name: Ensure the workspace is clean | |
run: | | |
rm -rf "${{ github.workspace }}" | |
mkdir "${{ github.workspace }}" | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
- name: Run test | |
env: | |
IMAGE_BAKER_SA: ${{ secrets.IMAGE_BAKER_SA }} | |
run: | | |
if [ ${{ matrix.cloud }} == google ]; then | |
echo "$IMAGE_BAKER_SA" > sa.json | |
if ! spread "${{ matrix.cloud }}:${{ matrix.source }}:tasks/${{ matrix.cloud }}/update-image/${{ matrix.group }}"; then | |
echo "Spread images task failed, exiting..." | |
exit 1 | |
fi | |
spread "${{ matrix.cloud }}:${{ matrix.target }}:tasks/${{ matrix.cloud }}/common/clean-old-images" | |
elif [ ${{ matrix.cloud }} == openstack ]; then | |
echo "Openstack updates not supported yet, exiting..." | |
exit 1 | |
else | |
echo "${{ matrix.cloud }} updates not supported, exiting..." | |
exit 1 | |
fi | |
- name: Discard spread workers | |
if: always() | |
run: | | |
shopt -s nullglob; | |
for r in .spread-reuse.*.yaml; do | |
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')"; | |
done | |
- name: Cleanup job workspace after run tests | |
if: always() | |
run: | | |
rm -rf "${{ github.workspace }}" | |
mkdir "${{ github.workspace }}" |