2024-08-25 16:20:53 -06:00
|
|
|
name: 'Oasis Config Action'
|
|
|
|
description: 'Configure env for deploying apps using Oasis'
|
2024-02-13 16:25:01 -07:00
|
|
|
inputs:
|
|
|
|
kubeconfig:
|
2024-08-25 16:20:53 -06:00
|
|
|
description: 'A base64 encoded string of the kubeconfig to use. Required!'
|
|
|
|
required: true
|
2024-08-24 20:27:56 -06:00
|
|
|
forgejo-token:
|
2024-08-25 16:20:53 -06:00
|
|
|
description: 'Forgejo token for downloading repositories'
|
|
|
|
required: false
|
|
|
|
default: ${{ env.DEVOPS_FORGEJO_ELYSIUM_ORG_READ_TOKEN }} # Action can't read env, so we need to reset it later
|
2024-02-13 16:25:01 -07:00
|
|
|
garden-version:
|
2024-08-25 16:20:53 -06:00
|
|
|
description: 'Version of Garden to deploy'
|
|
|
|
required: false
|
|
|
|
default: 0.13.29
|
2024-02-13 16:25:01 -07:00
|
|
|
oasis-branch:
|
2024-08-25 16:20:53 -06:00
|
|
|
description: 'Branch of Oasis to use'
|
|
|
|
required: false
|
|
|
|
default: master
|
|
|
|
oasis-workspace:
|
|
|
|
descipriont: 'Workspace to setup Oasis'
|
|
|
|
required: false
|
|
|
|
default: ${{ forgejo.workspace }}/oasis
|
2024-02-13 16:25:01 -07:00
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
# Set additional Envars
|
|
|
|
- name: Setting Short Commit Sha
|
|
|
|
run: echo SHORT_COMMIT_SHA=$(echo $GITHUB_SHA | cut -c 1-6) >> $GITHUB_ENV
|
|
|
|
- name: Setup Enviornment Variables
|
2024-02-14 20:43:59 -07:00
|
|
|
shell: bash
|
2024-02-13 16:25:01 -07:00
|
|
|
run: |
|
|
|
|
echo CI_NAMESPACE=ci-$SHORT_COMMIT_SHA >> $GITHUB_ENV
|
2024-08-24 20:27:56 -06:00
|
|
|
echo DEVOPS_FORGEJO_ELYSIUM_ORG_READ_TOKEN=${{ inputs.forgejo-token }} >> $GITHUB_ENV
|
2024-02-14 21:40:14 -07:00
|
|
|
echo "Checking out Oasis"
|
2024-08-25 16:20:53 -06:00
|
|
|
# Checkout Oasis
|
2024-08-25 16:24:33 -06:00
|
|
|
# - name: Checkout Oasis
|
|
|
|
# uses: actions/checkout@v3
|
|
|
|
# with:
|
|
|
|
# repository: "elysium/oasis"
|
|
|
|
# path: ${{ inputs.oasis-workspace }}
|
|
|
|
# token: ${{ env.DEVOPS_FORGEJO_ELYSIUM_ORG_READ_TOKEN }}
|
|
|
|
# ref: ${{ inputs.oasis-branch }}
|
|
|
|
# - name: Download Garden
|
|
|
|
# shell: bash
|
|
|
|
# env:
|
|
|
|
# GARDEN_BIN_VERSION: ${{ inputs.garden-version }}
|
|
|
|
# GARDEN_DIR: ${{ runner.temp }}/garden
|
|
|
|
# run: |
|
|
|
|
# # Install Garden
|
|
|
|
# mkdir -p "$GARDEN_DIR"
|
|
|
|
# cd "$GARDEN_DIR"
|
|
|
|
# if ! [ -d "$GARDEN_BIN_VERSION" ]; then
|
|
|
|
# echo "Downloading ${GARDEN_BIN_VERSION}..."
|
|
|
|
# if [[ "$GARDEN_BIN_VERSION" = "latest" ]]; then
|
|
|
|
# tag_param=""
|
|
|
|
# else
|
|
|
|
# tag_param="$GARDEN_BIN_VERSION"
|
|
|
|
# fi
|
|
|
|
# fi
|
|
|
|
# curl -sL https://get.garden.io/install.sh | bash -s -- $tag_param
|
|
|
|
# echo PATH=$PATH:$HOME/.garden/bin >> $GITHUB_ENV
|
|
|
|
# git config --global --add safe.directory $HOME/.garden/bin/static
|
|
|
|
# echo "Finished intalling Garden!"
|
|
|
|
# # Configure K&S
|
|
|
|
# - name: Configure K8S
|
|
|
|
# run: |
|
|
|
|
# echo "Setup kubeconfig"
|
|
|
|
# mkdir -p ~/.kube &&
|
|
|
|
# echo ${{ inputs.kubeconfig }} | base64 -d > ~/.kube/config &&
|
|
|
|
# chmod 700 ~/.kube/config
|
|
|
|
# echo "Finished setting up kubeconfig"
|
|
|
|
# - name: Export Envars
|
|
|
|
# shell: bash
|
|
|
|
# run: |
|
|
|
|
# # Export environment variables
|
|
|
|
# echo OASIS_WORKSPACE=${{ inputs.oasis-workspace }} >> $GITHUB_ENV
|
2024-08-25 16:20:53 -06:00
|
|
|
|