33 lines
1.2 KiB
YAML
33 lines
1.2 KiB
YAML
# Manual deploy of an arbitrary existing image tag to a chosen environment.
|
|
# Primary use: ROLLBACK (deploy a previous v* tag) and ad-hoc redeploys.
|
|
#
|
|
# The image_tag must already exist in the registry (e.g. v1.2.2 or sha-abc1234). deploy.sh
|
|
# derives the git ref to check out from it (strips a leading "sha-").
|
|
name: deploy-dispatch
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
environment:
|
|
description: Target environment
|
|
type: choice
|
|
options: [staging, prod]
|
|
required: true
|
|
image_tag:
|
|
description: Image tag to deploy, e.g. v1.2.2 or sha-abc1234
|
|
type: string
|
|
required: true
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: [self-hosted]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Deploy ${{ inputs.image_tag }} to ${{ inputs.environment }}
|
|
env:
|
|
DEPLOY_HOST: ${{ inputs.environment == 'prod' && secrets.PROD_SSH_HOST || secrets.STAGING_SSH_HOST }}
|
|
DEPLOY_USER: ${{ inputs.environment == 'prod' && secrets.PROD_SSH_USER || secrets.STAGING_SSH_USER }}
|
|
DEPLOY_SSH_KEY: ${{ inputs.environment == 'prod' && secrets.PROD_SSH_KEY || secrets.STAGING_SSH_KEY }}
|
|
IMAGE_TAG: ${{ inputs.image_tag }}
|
|
run: bash dev/ci/deploy.sh
|