From e4cd7950816438d988c6f2500272120acaf2fc88 Mon Sep 17 00:00:00 2001 From: Dunemask Date: Thu, 15 Feb 2024 16:14:02 -0700 Subject: [PATCH] [FEATURE] Auto Oasis Test --- action.yml | 75 +++++++++++++++++++++++++----------------------------- 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/action.yml b/action.yml index 1d98d9c..3501bbe 100644 --- a/action.yml +++ b/action.yml @@ -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 }} - - -