Skip to content

Commit 7e23062

Browse files
committed
testing-farm-sse-bridge: Create repo from CI
It seems quay.io doesn't automatically create a repository when you push to it, which is breaking CI. As a workaround, since I don't think I have access to create the repository from the web ui, just create it in CI before pushing to it.
1 parent 4898825 commit 7e23062

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/build-and-push.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,30 @@ jobs:
5252
build-and-push-testing-farm-sse-bridge:
5353
runs-on: ubuntu-latest
5454
steps:
55+
- name: Ensure Repo Exists
56+
run: |
57+
curl -s -o response.txt -w "%{http_code}" -X POST https://quay.io/api/v1/repository \
58+
-H "Content-Type: application/json" \
59+
-u "${{ secrets.REGISTRY_LOGIN }}:${{ secrets.REGISTRY_TOKEN }}" \
60+
-d "{
61+
\"namespace\": \"jotnar\",
62+
\"repository\": \"testing-farm-sse-bridge\",
63+
\"description\": \"Testing Farm SSE Bridge container\",
64+
\"visibility\": \"public\",
65+
\"repo_kind\": \"image\"
66+
}" | {
67+
read status
68+
if [[ "$status" == "200" || "$status" == "201" ]]; then
69+
echo "✅ ✅ Repo created or already exists."
70+
elif [[ "$status" == "409" ]]; then
71+
echo "✅ Repo already exists."
72+
else
73+
echo "❌ Failed to create repo. Status: $status"
74+
cat response.txt
75+
exit 1
76+
fi
77+
}
78+
5579
- name: Build and push testing-farm-sse-bridge to quay.io registry
5680
uses: sclorg/build-and-push-action@v4
5781
with:

0 commit comments

Comments
 (0)