Deploy #126
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: "Environment (test/prod)" | |
required: true | |
default: "test" | |
project_type: | |
description: "Project Type (EAO/GDX)" | |
required: false | |
default: "GDX" # Default value is GDX | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./openshift | |
env: | |
TAG_NAME: "${{ github.event.inputs.environment || 'test' }}" # If the environment type is manually selected, use the input value; otherwise, use 'test' as default | |
PROJECT_TYPE: "${{ github.event.inputs.project_type || 'GDX' }}" # If the project type is manually selected, use the input value; otherwise, use 'GDX' as default | |
# Set OpenShift related variables based on PROJECT_TYPE | |
OPENSHIFT_LOGIN_REGISTRY: ${{ secrets.OPENSHIFT_LOGIN_REGISTRY }} | |
OPENSHIFT_SA_TOKEN: ${{ (github.event.inputs.project_type == 'EAO') && secrets.OPENSHIFT_SA_TOKEN_EAO || secrets.OPENSHIFT_SA_TOKEN }} | |
OPENSHIFT_REPOSITORY: ${{ (github.event.inputs.project_type == 'EAO') && secrets.OPENSHIFT_REPOSITORY_EAO || secrets.OPENSHIFT_REPOSITORY }} | |
jobs: | |
met-deployment: | |
runs-on: ubuntu-20.04 | |
environment: | |
name: ${{ github.event.inputs.environment }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login Openshift | |
shell: bash | |
run: | | |
oc login --server=${{env.OPENSHIFT_LOGIN_REGISTRY}} --token=${{env.OPENSHIFT_SA_TOKEN}} | |
- name: Tag Images and Rollout | |
shell: bash | |
run: | | |
sh deploy.sh ${{ github.event.inputs.environment }} ${{env.OPENSHIFT_REPOSITORY }} |