2024-02-15 16:14:02 -07:00
|
|
|
name: Oasis Auto Config Action
|
|
|
|
description: Configure env for deploying apps using Oasis Automagically
|
2024-02-14 22:04:41 -07:00
|
|
|
inputs:
|
2024-02-15 16:45:22 -07:00
|
|
|
infisical-token:
|
2024-02-15 19:01:20 -07:00
|
|
|
description: Infisical token for CI or Edge
|
2024-02-15 16:37:52 -07:00
|
|
|
required: true
|
2024-02-14 22:04:41 -07:00
|
|
|
deploy-env:
|
2024-02-15 16:14:02 -07:00
|
|
|
description: Deploy Environment (ci or edge)
|
|
|
|
required: true
|
2024-02-15 16:52:09 -07:00
|
|
|
kubeconfig:
|
|
|
|
description: Kubeconfig for Oasis
|
|
|
|
required: false
|
2024-02-15 17:50:51 -07:00
|
|
|
extra-secret-paths:
|
|
|
|
description: Additional Secrets to fetch
|
|
|
|
required: false
|
|
|
|
extra-secret-envs:
|
|
|
|
description: Additional Envs for secrets to fetch
|
|
|
|
required: false
|
2024-02-14 22:04:41 -07:00
|
|
|
garden-version:
|
2024-02-15 16:14:02 -07:00
|
|
|
description: Version of Garden to deploy
|
|
|
|
required: false
|
2024-02-14 22:04:41 -07:00
|
|
|
oasis-branch:
|
2024-02-15 16:14:02 -07:00
|
|
|
description: Branch of Oasis to use
|
|
|
|
required: false
|
|
|
|
default: master
|
|
|
|
oasis-workspace:
|
|
|
|
descipriont: Workspace to setup Oasis
|
|
|
|
required: false
|
2024-02-14 22:04:41 -07:00
|
|
|
runs:
|
2024-02-15 16:48:27 -07:00
|
|
|
using: composite
|
2024-02-14 22:04:41 -07:00
|
|
|
steps:
|
|
|
|
- name: Configure Workflow
|
|
|
|
shell: bash
|
2024-02-15 16:14:46 -07:00
|
|
|
run: |
|
2024-02-15 16:14:02 -07:00
|
|
|
if [ ${{ inputs.deploy-env }} == "edge" ]; then
|
2024-02-18 16:05:29 -07:00
|
|
|
WORKFLOW_SECRET=/workflows/oasis-edge-deploy,/workflows/discord
|
2024-02-15 16:14:02 -07:00
|
|
|
elif [ ${{ inputs.deploy-env }} == "ci" ]; then
|
2024-02-18 16:05:29 -07:00
|
|
|
WORKFLOW_SECRET=/workflows/oasis-ci-deploy,/workflows/discord
|
2024-02-15 16:14:02 -07:00
|
|
|
else
|
|
|
|
echo "Error! deploy-env required, and must be 'ci' or 'edge'!"
|
|
|
|
exit 1
|
|
|
|
fi
|
2024-02-15 17:50:51 -07:00
|
|
|
# Save Envars
|
|
|
|
echo OASIS_INFISICAL_TOKEN=${{ inputs.infisical-token }} >> $GITHUB_ENV
|
2024-02-15 18:07:58 -07:00
|
|
|
echo OASIS_PATH_FETCH=$WORKFLOW_SECRET,${{ inputs.extra-secret-paths }} >> $GITHUB_ENV # /workflows/oasis-<deploy-type>-deploy, ...extra-secret-paths
|
|
|
|
echo OASIS_ENV_FETCH=${{ inputs.deploy-env }},${{ inputs.extra-secret-envs }} >> $GITHUB_ENV #<deploy-type>, ...extra-secret-envs
|
2024-02-14 22:04:41 -07:00
|
|
|
- name: Setup Oasis Envars
|
|
|
|
uses: https://gitea.dunemask.dev/elysium/elysium-actions@infisical-env
|
|
|
|
with:
|
2024-02-15 10:31:21 -07:00
|
|
|
infisical-token: ${{ env.OASIS_INFISICAL_TOKEN }}
|
2024-02-15 18:07:23 -07:00
|
|
|
secret-envs: ${{ env.OASIS_ENV_FETCH }}
|
2024-02-15 17:50:51 -07:00
|
|
|
secret-paths: ${{ env.OASIS_PATH_FETCH }}
|
2024-02-15 10:31:21 -07:00
|
|
|
- name: Configure Kubeconfig
|
2024-02-15 16:14:02 -07:00
|
|
|
shell: bash
|
2024-02-15 16:14:46 -07:00
|
|
|
run: |
|
2024-02-15 18:13:12 -07:00
|
|
|
if [ -n "${{ inputs.kubeconfig }}" ] && [ "${{ inputs.kubeconfig }}" != "" ]; then
|
2024-02-15 16:55:46 -07:00
|
|
|
echo "Using Provided Kubernetes Config"
|
|
|
|
echo OASIS_WORKFLOW_KUBECONFIG=${{ inputs.kubeconfig }} >> $GITHUB_ENV
|
2024-02-15 18:13:12 -07:00
|
|
|
elif [ "${{ inputs.deploy-env }}" == "edge" ]; then
|
2024-02-15 16:53:30 -07:00
|
|
|
echo "Using Edge Kubernetes Config"
|
2024-02-15 16:14:02 -07:00
|
|
|
echo OASIS_WORKFLOW_KUBECONFIG=${{env.KUBERNETES_CONFIG_USW_EDGE}} >> $GITHUB_ENV
|
2024-02-15 18:13:12 -07:00
|
|
|
elif [ "${{ inputs.deploy-env }}" == "ci" ]; then
|
2024-02-15 16:53:30 -07:00
|
|
|
echo "Using Dev Kubernetes Config"
|
2024-02-15 16:25:09 -07:00
|
|
|
echo OASIS_WORKFLOW_KUBECONFIG=${{env.KUBERNETES_CONFIG_USW_DEV}} >> $GITHUB_ENV
|
2024-02-15 16:14:02 -07:00
|
|
|
else
|
|
|
|
echo "Error! deploy-env required, and must be 'ci' or 'edge'!"
|
|
|
|
exit 1
|
|
|
|
fi
|
2024-02-15 10:31:21 -07:00
|
|
|
- name: Oasis Setup
|
|
|
|
uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-setup-advanced
|
|
|
|
with:
|
2024-02-15 10:36:39 -07:00
|
|
|
garden-version: ${{ inputs.garden-version }}
|
|
|
|
oasis-branch: ${{ inputs.oasis-branch }}
|
|
|
|
oasis-workspace: ${{ inputs.oasis-workspace }}
|
2024-02-15 10:31:21 -07:00
|
|
|
kubeconfig: ${{ env.OASIS_WORKFLOW_KUBECONFIG }}
|