Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

OpenShift Dev Env

OpenShift Dev Env #803

name: OpenShift Dev Env
on:
workflow_dispatch:
inputs:
action:
type: choice
description: Start or Stop?
options:
- start
- stop
schedule:
# Force stopping dev env every night for cost savings
- cron: '0 0 * * *'
jobs:
env:
runs-on: ubuntu-latest
steps:
- name: Start OpenShift env
if: github.event.inputs.action == 'start'
run: |
aws ec2 start-instances --instance-ids ${{secrets.OPENSHIFT_AWS_INSTANCE_ID }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.OPENSHIFT_AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.OPENSHIFT_AWS_KEY_SECRET }}
AWS_DEFAULT_REGION: ${{ secrets.OPENSHIFT_AWS_REGION }}
- name: Stop OpenShift env
if: github.event.inputs.action == 'stop' || github.event.inputs.action == ''
run: |
aws ec2 stop-instances --instance-ids ${{secrets.OPENSHIFT_AWS_INSTANCE_ID }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.OPENSHIFT_AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.OPENSHIFT_AWS_KEY_SECRET }}
AWS_DEFAULT_REGION: ${{ secrets.OPENSHIFT_AWS_REGION }}