Skip to content

Commit 1ec0262

Browse files
committed
doca workflow: clean up image and only run on relevant changes
1 parent d694f1d commit 1ec0262

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

.github/workflows/doca.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,18 @@ on:
55
branches:
66
- main
77
paths:
8-
- '**'
9-
- '!dev/**'
10-
- 'dev/setup-env.sh'
11-
- '!docs/**'
12-
- '!README.md'
13-
- '!.gitignore'
14-
- '!.github/workflows/'
8+
- 'environments/.stackhpc/terraform/cluster_image.auto.tfvars.json'
9+
- 'ansible/roles/doca/**'
1510
- '.github/workflows/doca'
1611
pull_request:
1712
paths:
18-
- '**'
19-
- '!dev/**'
20-
- 'dev/setup-env.sh'
21-
- '!docs/**'
22-
- '!README.md'
23-
- '!.gitignore'
24-
- '!.github/workflows/'
13+
- 'environments/.stackhpc/terraform/cluster_image.auto.tfvars.json'
14+
- 'ansible/roles/doca/**'
2515
- '.github/workflows/doca'
2616

2717
jobs:
28-
openstack:
29-
name: openstack-docabuild
18+
doca:
19+
name: doca-build
3020
concurrency:
3121
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.build.image_name }} # to branch/PR + OS
3222
cancel-in-progress: true
@@ -116,9 +106,22 @@ jobs:
116106
sleep 5
117107
done
118108
IMAGE_NAME=$(openstack image show -f value -c name $IMAGE_ID)
109+
echo "image-name=${IMAGE_NAME}" >> "$GITHUB_OUTPUT"
110+
echo "image-id=$IMAGE_ID" >> "$GITHUB_OUTPUT"
119111
echo $IMAGE_ID > image-id.txt
120112
echo $IMAGE_NAME > image-name.txt
121113
114+
- name: Make image usable for further builds
115+
run: |
116+
. venv/bin/activate
117+
openstack image unset --property signature_verified "${{ steps.manifest.outputs.image-id }}"
118+
119+
- name: Delete image for automatically-run workflows
120+
run: |
121+
. venv/bin/activate
122+
openstack image delete "${{ steps.manifest.outputs.image-id }}"
123+
if: ${{ github.event_name != 'workflow_dispatch' }}
124+
122125
- name: Upload manifest artifact
123126
uses: actions/upload-artifact@v4
124127
with:

0 commit comments

Comments
 (0)