Skip to content

Alpha Deployment

Alpha Deployment #109

name: "Alpha Deployment"
on:
workflow_dispatch:
inputs:
version_tag:
description: "Version to deploy.(e.g., v1.0.0-alpha.1)"
required: true
event_processor_tag:
description: "Event processor version to use for this deployment.(e.g., 1.0.0-beta)"
required: true
jobs:
validations:
name: Validate permissions
runs-on: ubuntu-24.04
steps:
- name: Check permissions
run: |
echo "Checking permissions..."
if [[ "${{ github.event.inputs.version_tag }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-alpha\.[0-9]+$ ]]; then
echo "✅ Version tag format is correct."
if [[ "${{ github.ref }}" =~ ^refs/heads/(release/|feature/) ]]; then
echo "✅ Base branch ${{ github.ref }} is valid."
else
echo "⛔ ERROR: Base branch ${{ github.ref }} is not valid. It should be release/ or feature/."
exit 1
fi
echo "Validating user permissions..."
RESPONSE=$(curl -s -H "Authorization: Bearer ${{ secrets.API_SECRET }}" \
-H "Accept: application/vnd.github.json" \
"https://api.github.com/orgs/utmstack/teams/integration-developers/memberships/${{ github.actor }}")
if echo "$RESPONSE" | grep -q '"state": "active"'; then
echo "✅ User ${{ github.actor }} is a member of the integration-developers team."
else
RESPONSE=$(curl -s -H "Authorization: Bearer ${{ secrets.API_SECRET }}" \
-H "Accept: application/vnd.github.json" \
"https://api.github.com/orgs/utmstack/teams/core-developers/memberships/${{ github.actor }}")
if echo "$RESPONSE" | grep -q '"state": "active"'; then
echo "✅ User ${{ github.actor }} is a member of the core-developers team."
else
echo "⛔ ERROR: User ${{ github.actor }} is not a member of the core-developers or integration-developers team."
echo $RESPONSE
exit 1
fi
fi
else
echo "⛔ Version tag format is incorrect. It should be in the format vX.Y.Z-alpha.N."
exit 1
fi
deploy:
name: Deploy to Alpha
needs: validations
uses: ./.github/workflows/v11-used-build.yml
with:
version_tag: ${{ github.event.inputs.version_tag }}
event_processor_tag: ${{ github.event.inputs.event_processor_tag }}
environment: alpha
secrets:
AGENT_SECRET_PREFIX: ${{ secrets.AGENT_SECRET_PREFIX }}
SIGNER_TOKEN: ${{ secrets.SIGNER_TOKEN }}
CM_AUTH: ${{ secrets.CM_AUTH_ALPHA }}
schedule:
name: Schedule release to alpha
needs: deploy
runs-on: ubuntu-24.04
steps:
- name: Run publisher
run: |
curl -sSL -H "Authorization: Bearer ${{ secrets.SIGNER_TOKEN }}" \
"http://customermanager.utmstack.com:8081/api/v1/fs/v11-alpha/version-publisher" -o ./version-publisher
chmod +x ./version-publisher
./version-publisher '43cb25b3-1426-4c77-8bbe-b2e0b491ce08' '${{ github.event.inputs.version_tag }}'
echo "Scheduled release to alpha for version ${{ github.event.inputs.version_tag }}."