This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
OpenShift Dev Env #797
Workflow file for this run
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: 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 }} |