Skip to content

Deploy service b (main) to stage environment #7

Deploy service b (main) to stage environment

Deploy service b (main) to stage environment #7

Workflow file for this run

name: Deploy to Environment
run-name: Deploy service ${{ inputs.service_name}} (${{ inputs.checkout_ref }}) to ${{ inputs.environment }} environment
on:
workflow_dispatch:
inputs:
checkout_ref:
description: 'Git reference to checkout (e.g., main, feature/xyz)'
required: true
service_name:
description: 'Service name'
required: true
type: choice
options:
- a
- b
environment:
description: 'Target deployment environment (dev, stage, prod)'
required: true
type: choice
options:
- dev
- stage
- prod
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.environment }}
defaults:
run:
working-directory: services/${{ inputs.service_name }}/
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.checkout_ref }}
- name: Deploy to environment
run: |
# Implement deployment steps based on the selected environment
echo "Deploying to ${{ github.event.inputs.environment }}"
./deploy.sh