[FEATURE] Auto Oasis Test

This commit is contained in:
Dunemask 2024-02-15 16:14:02 -07:00
parent a18f49543e
commit e4cd795081

View file

@ -1,55 +1,53 @@
name: 'Oasis Auto Config Action'
description: 'Configure env for deploying apps using Oasis Automagically'
name: Oasis Auto Config Action
description: Configure env for deploying apps using Oasis Automagically
inputs:
deploy-env:
description: 'Deploy Environment (ci or edge)'
required: true
description: Deploy Environment (ci or edge)
required: true
garden-version:
description: 'Version of Garden to deploy'
required: false
description: Version of Garden to deploy
required: false
oasis-branch:
description: 'Branch of Oasis to use'
required: false
default: master
oasis-workspace:
descipriont: 'Workspace to setup Oasis'
required: false
description: Branch of Oasis to use
required: false
default: master
oasis-workspace:
descipriont: Workspace to setup Oasis
required: false
runs:
using: "composite"
using: composite
steps:
- name: Configure Workflow
shell: bash
echo OASIS_ENV_STRATEGY=${{ inputs.deploy-env }} >> $GITHUB_ENV
if [ ${{ inputs.deploy-env }} == "edge" ]; then
echo OASIS_INFISICAL_TOKEN=${{ secrets.INFISICAL_ELYSIUM_PROD_READ_TOKEN }} >> $GITHUB_ENV
echo OASIS_INFISICAL_WORKFLOW=/workflows/oasis-edge-deploy >> $GITHUB_ENV
elif [ ${{ inputs.deploy-env }} == "ci" ]; then
echo OASIS_INFISICAL_TOKEN=${{ secrets.INFISICAL_ELYSIUM_PROD_READ_TOKEN }} >> $GITHUB_ENV
echo OASIS_INFISICAL_WORKFLOW=/workflows/oasis-edge-deploy >> $GITHUB_ENV
else
echo "Error! deploy-env required, and must be 'ci' or 'edge'!"
exit 1
fi
# Set additional Envars
run: >-
echo OASIS_ENV_STRATEGY=${{ inputs.deploy-env }} >> $GITHUB_ENV
if [ ${{ inputs.deploy-env }} == "edge" ]; then
echo OASIS_INFISICAL_TOKEN=${{ secrets.INFISICAL_ELYSIUM_PROD_READ_TOKEN }} >> $GITHUB_ENV
echo OASIS_INFISICAL_WORKFLOW=/workflows/oasis-edge-deploy >> $GITHUB_ENV
elif [ ${{ inputs.deploy-env }} == "ci" ]; then
echo OASIS_INFISICAL_TOKEN=${{ secrets.INFISICAL_ELYSIUM_PROD_READ_TOKEN }} >> $GITHUB_ENV
echo OASIS_INFISICAL_WORKFLOW=/workflows/oasis-edge-deploy >> $GITHUB_ENV
else
echo "Error! deploy-env required, and must be 'ci' or 'edge'!"
exit 1
fi
- name: Setup Oasis Envars
uses: https://gitea.dunemask.dev/elysium/elysium-actions@infisical-env
with:
infisical-token: ${{ env.OASIS_INFISICAL_TOKEN }}
environment: ${{ env.OASIS_ENV_STRATEGY}}
secret-path: ${{ env.OASIS_INFISICAL_WORKFLOW }}
- name: Configure Kubeconfig
shell: bash
echo OASIS_ENV_STRATEGY=${{ inputs.deploy-env }} >> $GITHUB_ENV
if [ ${{ inputs.deploy-env }} == "edge" ]; then
echo OASIS_WORKFLOW_KUBECONFIG=${{env.KUBERNETES_CONFIG_USW_DEV}} >> $GITHUB_ENV
elif [ ${{ inputs.deploy-env }} == "ci" ]; then
echo OASIS_WORKFLOW_KUBECONFIG=${{env.KUBERNETES_CONFIG_USW_EDGE}} >> $GITHUB_ENV
else
echo "Error! deploy-env required, and must be 'ci' or 'edge'!"
exit 1
fi
shell: bash
run: >-
if [ ${{ inputs.deploy-env }} == "edge" ]; then
echo OASIS_WORKFLOW_KUBECONFIG=${{env.KUBERNETES_CONFIG_USW_DEV}} >> $GITHUB_ENV
elif [ ${{ inputs.deploy-env }} == "ci" ]; then
echo OASIS_WORKFLOW_KUBECONFIG=${{env.KUBERNETES_CONFIG_USW_EDGE}} >> $GITHUB_ENV
else
echo "Error! deploy-env required, and must be 'ci' or 'edge'!"
exit 1
fi
- name: Oasis Setup
uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-setup-advanced
with:
@ -57,6 +55,3 @@ runs:
oasis-branch: ${{ inputs.oasis-branch }}
oasis-workspace: ${{ inputs.oasis-workspace }}
kubeconfig: ${{ env.OASIS_WORKFLOW_KUBECONFIG }}