deploy
This commit is contained in:
24
.github/workflows/deploy.yaml
vendored
24
.github/workflows/deploy.yaml
vendored
@@ -30,20 +30,22 @@ jobs:
|
|||||||
CR_REPO: ${{ github.event.repository.name }}
|
CR_REPO: ${{ github.event.repository.name }}
|
||||||
TAG: ${{ inputs.tag }}
|
TAG: ${{ inputs.tag }}
|
||||||
steps:
|
steps:
|
||||||
- name: deploy
|
- name: Map environment variable
|
||||||
if: inputs.environment == 'prod' || inputs.environment == 'demo'
|
id: map_env
|
||||||
uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/deploy@HEAD
|
run: |
|
||||||
with:
|
declare -A env_map=(
|
||||||
secrets: ${{ toJSON(secrets) }}
|
["prod"]="yc-transcoder"
|
||||||
environment: ${{ inputs.environment }}
|
["stage"]="stage"
|
||||||
tag: ${{ inputs.tag }}
|
)
|
||||||
migrate: ${{ inputs.migrate }}
|
mapped_env=${env_map[${{ inputs.environment }}]}
|
||||||
host: ${{ inputs.host }}
|
if [ -z "$mapped_env" ]; then
|
||||||
|
mapped_env="${{ inputs.environment }}"
|
||||||
|
fi
|
||||||
|
echo "mapped_environment=$mapped_env" >> $GITHUB_OUTPUT
|
||||||
- name: deploy k8s
|
- name: deploy k8s
|
||||||
if: inputs.environment == 'stage'
|
|
||||||
uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/k8s@HEAD
|
uses: https://bb.hublab.ru/HUB/workflows/.gitea/actions/k8s@HEAD
|
||||||
with:
|
with:
|
||||||
secrets: ${{ toJSON(secrets) }}
|
secrets: ${{ toJSON(secrets) }}
|
||||||
environment: ${{ inputs.environment }}
|
environment: ${{ steps.map_env.outputs.mapped_environment }}
|
||||||
tag: ${{ inputs.tag }}
|
tag: ${{ inputs.tag }}
|
||||||
migrate: ${{ inputs.migrate }}
|
migrate: ${{ inputs.migrate }}
|
||||||
Reference in New Issue
Block a user