43
All checks were successful
Deploy Production / Deploy to Staging (push) Has been skipped

This commit is contained in:
Alex Shevchuk
2025-08-19 17:26:53 +03:00
parent 2d79aa7437
commit 6a94118377
2 changed files with 133 additions and 115 deletions

View File

@@ -0,0 +1,51 @@
name: Trigger Deploy
on:
workflow_dispatch:
inputs:
environment:
description: Environment to deploy to
required: true
default: staging
type: choice
options:
- staging
- production
logLevel:
description: Log level
required: false
default: info
type: choice
options:
- info
- debug
- warning
jobs:
get_versions_and_trigger:
name: Get available versions and trigger deploy
runs-on: ubuntu-22.04
steps:
- name: Get available versions from Docker Registry
id: get_versions
env:
REGISTRY: hub.docker.com
REPO: ${{ github.repository }}
run: |
TAGS=$(wget -q -O - "https://$REGISTRY/v2/namespaces/molvaapp/repositories/$REPO/tags?page_size=100" | jq -r '.results[].name' | tr '\n' ',')
echo "version_options=${TAGS%,}" >> $GITHUB_OUTPUT
- name: Trigger main deployment workflow
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository: ${{ github.repository }}
event-type: deploy-request
client-payload: |
{
"environment": "${{ github.event.inputs.environment }}",
"version": "latest",
"logLevel": "${{ github.event.inputs.logLevel }}",
"available_versions": "${{ steps.get_versions.outputs.version_options }}"
}