Compare commits

..

20 commits

Author SHA1 Message Date
dunemask
902de144dc [CHORE] Bump garden to 13.29 2024-04-07 02:43:01 +00:00
636bb98d2f [FIX] Fixed Oasis 2024-02-14 21:40:14 -07:00
e8f5a00cef [DEBUG] Debug 2024-02-14 21:38:04 -07:00
08b815286f [DEBUG] Debug 2024-02-14 21:36:48 -07:00
7cbaae0be3 [DEBUG] Debug 2024-02-14 21:27:53 -07:00
6f64a8a9ff [DEBUG] Debug 2024-02-14 21:24:22 -07:00
cb90f85f92 [DEBUG] Debug 2024-02-14 21:08:40 -07:00
c021ec21ba [DEBUG] Debug 2024-02-14 20:46:00 -07:00
6b1260fa4b [DEBUG] Debug 2024-02-14 20:45:13 -07:00
3d7e62eb30 [DEBUG] Debug 2024-02-14 20:43:59 -07:00
a4697b2655 [DEBUG] Debug 2024-02-14 20:41:56 -07:00
dunemask
fec0d92bbe Update action.yml 2024-02-15 03:26:01 +00:00
dunemask
b59a89cf52 Update action.yml 2024-02-15 03:24:29 +00:00
dunemask
e7920efd42 Update action.yml 2024-02-15 03:23:43 +00:00
dunemask
a704cbfd10 Update action.yml 2024-02-15 03:19:39 +00:00
dunemask
dbf8182e81 Update action.yml 2024-02-15 03:18:12 +00:00
dunemask
72a9c62af4 [DEBUG] Action Debugging 2024-02-15 03:04:35 +00:00
f80938e7fa [FEATURE] Oasis Action 2024-02-13 23:46:09 -07:00
dunemask
1e632a3f91 Update README.md 2024-02-13 16:35:09 -07:00
56324c2d05 [FIX] Restored action to oasis-deploy 2024-02-13 16:25:01 -07:00

View file

@ -1,46 +1,77 @@
name: "S3 Backup Action"
description: "Backup to S3 Bucket"
name: 'Oasis Config Action'
description: 'Configure env for deploying apps using Oasis'
inputs:
infisical-token:
description: Infisical token for backup envars
required: true
infisical-project:
description: Infisical Project
required: true
s3-backup-path:
description: "Workspace to setup Oasis"
required: false
default: backups/forgejo-repositories/${{ gitea.repository }}
kubeconfig:
description: 'A base64 encoded string of the kubeconfig to use. Required!'
required: true
gitea-token:
description: 'Gitea token for downloading repositories'
required: false
default: ${{ env.DEVOPS_GITEA_ELYSIUM_ORG_READ_TOKEN }} # Action can't read env, so we need to reset it later
garden-version:
description: 'Version of Garden to deploy'
required: false
default: 0.13.29
oasis-branch:
description: 'Branch of Oasis to use'
required: false
default: master
oasis-workspace:
descipriont: 'Workspace to setup Oasis'
required: false
default: ${{ gitea.workspace}}/oasis
runs:
using: "composite"
steps:
# Checkout Repository
- name: Checkout Repository
# 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
shell: bash
run: |
echo CI_NAMESPACE=ci-$SHORT_COMMIT_SHA >> $GITHUB_ENV
echo DEVOPS_GITEA_ELYSIUM_ORG_READ_TOKEN=${{ inputs.gitea-token }} >> $GITHUB_ENV
echo "Checking out Oasis"
# Checkout Oasis
- name: Checkout Oasis
uses: actions/checkout@v3
with:
path: repo
# Load Backup Envars
- name: Setup Backup Envars
uses: https://forgejo.dunemask.dev/elysium/elysium-actions@infisical-env
with:
infisical-token: ${{ inputs.infisical-token }}
project-id: ${{ inputs.infisical-project }}
secret-envs: edge
secret-paths: /devops/forgejo-backups
# Fix Envar Format
- name: Fix Env Format
run: |
echo BACKUP_S3_ENDPOINT=${{ env.DEVOPS_FORGEJO_ELYSIUM_ORG_S3_ENDPOINT }} >> $GITHUB_ENV
echo BACKUP_S3_KEY_ID=${{ env.DEVOPS_FORGEJO_ELYSIUM_ORG_S3_KEY_ID }} >> $GITHUB_ENV
echo BACKUP_S3_KEY=${{ env.DEVOPS_FORGEJO_ELYSIUM_ORG_S3_KEY }} >> $GITHUB_ENV
# Backup Repository
- name: S3 Backup
uses: https://github.com/peter-evans/s3-backup@v1
repository: "elysium/oasis"
path: ${{ inputs.oasis-workspace }}
token: ${{ env.DEVOPS_GITEA_ELYSIUM_ORG_READ_TOKEN }}
ref: ${{ inputs.oasis-branch }}
- name: Download Garden
shell: bash
env:
STORAGE_SERVICE_URL: ${{ env.BACKUP_S3_ENDPOINT }}
ACCESS_KEY_ID: ${{ env.BACKUP_S3_KEY_ID }}
SECRET_ACCESS_KEY: ${{ env.BACKUP_S3_KEY }}
MIRROR_TARGET: ${{ inputs.s3-backup-path }}
MIRROR_SOURCE: repo
with:
args: --overwrite --remove
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