Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/api-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
AZURE_WEBAPP_NAME: app-dfx-api-dev
AZURE_WEBAPP_PACKAGE_PATH: '.'
NODE_VERSION: '20.x'
DEV_API_URL: https://dev.api.dfx.swiss

jobs:
build-and-deploy:
Expand Down Expand Up @@ -60,3 +61,28 @@ jobs:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.DEV_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

- name: Verify DEV deployment
timeout-minutes: 15
run: |
EXPECTED=${{ github.sha }}
echo "Expected commit: $EXPECTED"

for i in {1..30}; do
if RESPONSE=$(curl -sf ${{ env.DEV_API_URL }}/version 2>&1); then
ACTUAL=$(echo "$RESPONSE" | jq -r '.commit')
echo "Attempt $i: DEV running $ACTUAL"

if [ "$EXPECTED" == "$ACTUAL" ]; then
echo "DEV is running the latest develop commit"
exit 0
fi
else
echo "Attempt $i: DEV API not reachable"
fi

sleep 30
done

echo "::error::DEV is not running the latest develop commit after 15 minutes"
exit 1
36 changes: 0 additions & 36 deletions .github/workflows/api-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,8 @@ permissions:

env:
NODE_VERSION: '20.x'
DEV_API_URL: https://dev.api.dfx.swiss

jobs:
verify-dev-deployment:
name: Verify DEV Deployment
if: github.base_ref == 'main' && github.head_ref == 'develop'
runs-on: ubuntu-latest
steps:
- name: Wait for DEV deployment
timeout-minutes: 15
run: |
EXPECTED=${{ github.event.pull_request.head.sha }}
echo "Expected commit: $EXPECTED"

if [ -z "$EXPECTED" ] || [ "$EXPECTED" == "null" ]; then
echo "::error::Could not determine expected commit SHA"
exit 1
fi

for i in {1..30}; do
if RESPONSE=$(curl -sf ${{ env.DEV_API_URL }}/version 2>&1); then
ACTUAL=$(echo "$RESPONSE" | jq -r '.commit')
echo "Attempt $i: DEV running $ACTUAL"

if [ "$EXPECTED" == "$ACTUAL" ]; then
echo "DEV is running the latest develop commit"
exit 0
fi
else
echo "Attempt $i: DEV API not reachable"
fi

sleep 30
done

echo "::error::DEV is not running the latest develop commit after 15 minutes"
exit 1

build:
name: Build and test
if: github.head_ref != 'develop'
Expand Down
Loading