Compare commits
21 commits
oasis-setu
...
s3-backup
Author | SHA1 | Date | |
---|---|---|---|
bf54b80924 | |||
b8805d941b | |||
f3acd807bf | |||
181c35fac5 | |||
f4f89dad0d | |||
f0038b6b69 | |||
962ca38ff9 | |||
ba73b418a8 | |||
30096f817f | |||
bb8787fded | |||
1e3c32b3e7 | |||
75bd9ebc6d | |||
8fd38af4f8 | |||
8646f62cbe | |||
41d4305f3a | |||
2dc6d1bbd1 | |||
02ebb4634f | |||
4d55f5c1e7 | |||
7b513727bb | |||
26eff76d90 | |||
881621c35c |
2 changed files with 34 additions and 69 deletions
|
@ -6,9 +6,8 @@ The actions are used by Elysium to run CI/CD tasks and this repo will be archive
|
||||||
|
|
||||||
The actions available are:
|
The actions available are:
|
||||||
- [S3 Backup](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/s3-backup/action.yml)
|
- [S3 Backup](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/s3-backup/action.yml)
|
||||||
- [Oasis Auto Setup](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/oasis-setup-auto/action.yml)
|
- [Oasis Deploy](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/oasis-deploy/action.yml)
|
||||||
- [Infisical Env](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/infisical-env/action.yml)
|
- [Infisical Env](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/infisical-env/action.yml)
|
||||||
- [Oasis Advanced Setup](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/oasis-setup-advanced/action.yml)
|
|
||||||
- [Elysium CI/CD](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/elysium-ci-cd/action.yml)
|
- [Elysium CI/CD](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/elysium-ci-cd/action.yml)
|
||||||
|
|
||||||
## Workflow Template
|
## Workflow Template
|
||||||
|
|
100
action.yml
100
action.yml
|
@ -1,80 +1,46 @@
|
||||||
name: Oasis Auto Config Action
|
name: "S3 Backup Action"
|
||||||
description: Configure env for deploying apps using Oasis Automagically
|
description: "Backup to S3 Bucket"
|
||||||
inputs:
|
inputs:
|
||||||
infisical-token:
|
infisical-token:
|
||||||
description: Infisical token for CI or Edge
|
description: Infisical token for backup envars
|
||||||
required: true
|
required: true
|
||||||
infisical-project:
|
infisical-project:
|
||||||
description: Infisical Project For Secrets
|
description: Infisical Project
|
||||||
required: true
|
required: true
|
||||||
deploy-env:
|
s3-backup-path:
|
||||||
description: Deploy Environment (ci or edge)
|
description: "Workspace to setup Oasis"
|
||||||
required: true
|
|
||||||
kubeconfig:
|
|
||||||
description: Kubeconfig for Oasis
|
|
||||||
required: false
|
required: false
|
||||||
extra-secret-paths:
|
default: backups/forgejo-repositories/${{ gitea.repository }}
|
||||||
description: Additional Secrets to fetch
|
|
||||||
required: false
|
|
||||||
extra-secret-envs:
|
|
||||||
description: Additional Envs for secrets to fetch
|
|
||||||
required: false
|
|
||||||
garden-version:
|
|
||||||
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
|
|
||||||
default: ${{ gitea.workspace }}/oasis
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Configure Workflow
|
# Checkout Repository
|
||||||
shell: bash
|
- name: Checkout Repository
|
||||||
run: |
|
uses: actions/checkout@v3
|
||||||
if [ ${{ inputs.deploy-env }} == "edge" ]; then
|
with:
|
||||||
WORKFLOW_SECRET=/workflows/oasis-edge-deploy,/workflows/discord
|
path: repo
|
||||||
elif [ ${{ inputs.deploy-env }} == "ci" ]; then
|
# Load Backup Envars
|
||||||
WORKFLOW_SECRET=/workflows/oasis-ci-deploy,/workflows/discord
|
- name: Setup Backup Envars
|
||||||
else
|
|
||||||
echo "Error! deploy-env required, and must be 'ci' or 'edge'!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# Save Envars
|
|
||||||
echo OASIS_INFISICAL_TOKEN=${{ inputs.infisical-token }} >> $GITHUB_ENV
|
|
||||||
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.deploy-env}},${{ inputs.extra-secret-envs }} >> $GITHUB_ENV #<deploy-type>, ...extra-secret-envs
|
|
||||||
- name: Setup Oasis Envars
|
|
||||||
uses: https://forgejo.dunemask.dev/elysium/elysium-actions@infisical-env
|
uses: https://forgejo.dunemask.dev/elysium/elysium-actions@infisical-env
|
||||||
with:
|
with:
|
||||||
infisical-token: ${{ env.OASIS_INFISICAL_TOKEN }}
|
infisical-token: ${{ inputs.infisical-token }}
|
||||||
project-id: ${{ inputs.infisical-project }}
|
project-id: ${{ inputs.infisical-project }}
|
||||||
secret-envs: ${{ env.OASIS_ENV_FETCH }}
|
secret-envs: edge
|
||||||
secret-paths: ${{ env.OASIS_PATH_FETCH }}
|
secret-paths: /devops/forgejo-backups
|
||||||
- name: Configure Kubeconfig
|
# Fix Envar Format
|
||||||
shell: bash
|
- name: Fix Env Format
|
||||||
run: |
|
run: |
|
||||||
if [ -n "${{ inputs.kubeconfig }}" ] && [ "${{ inputs.kubeconfig }}" != "" ]; then
|
echo BACKUP_S3_ENDPOINT=${{ env.DEVOPS_FORGEJO_ELYSIUM_ORG_S3_ENDPOINT }} >> $GITHUB_ENV
|
||||||
echo "Using Provided Kubernetes Config"
|
echo BACKUP_S3_KEY_ID=${{ env.DEVOPS_FORGEJO_ELYSIUM_ORG_S3_KEY_ID }} >> $GITHUB_ENV
|
||||||
echo OASIS_WORKFLOW_KUBECONFIG=${{ inputs.kubeconfig }} >> $GITHUB_ENV
|
echo BACKUP_S3_KEY=${{ env.DEVOPS_FORGEJO_ELYSIUM_ORG_S3_KEY }} >> $GITHUB_ENV
|
||||||
elif [ "${{ inputs.deploy-env }}" == "edge" ]; then
|
# Backup Repository
|
||||||
echo "Using Edge Kubernetes Config"
|
- name: S3 Backup
|
||||||
echo OASIS_WORKFLOW_KUBECONFIG=${{env.KUBERNETES_CONFIG_USW_EDGE}} >> $GITHUB_ENV
|
uses: https://github.com/peter-evans/s3-backup@v1
|
||||||
elif [ "${{ inputs.deploy-env }}" == "ci" ]; then
|
env:
|
||||||
echo "Using Dev Kubernetes Config"
|
STORAGE_SERVICE_URL: ${{ env.BACKUP_S3_ENDPOINT }}
|
||||||
echo OASIS_WORKFLOW_KUBECONFIG=${{env.KUBERNETES_CONFIG_USW_DEV}} >> $GITHUB_ENV
|
ACCESS_KEY_ID: ${{ env.BACKUP_S3_KEY_ID }}
|
||||||
else
|
SECRET_ACCESS_KEY: ${{ env.BACKUP_S3_KEY }}
|
||||||
echo "Error! deploy-env required, and must be 'ci' or 'edge'!"
|
MIRROR_TARGET: ${{ inputs.s3-backup-path }}
|
||||||
exit 1
|
MIRROR_SOURCE: repo
|
||||||
fi
|
|
||||||
- name: Oasis Setup
|
|
||||||
uses: https://forgejo.dunemask.dev/elysium/elysium-actions@oasis-setup-advanced
|
|
||||||
with:
|
with:
|
||||||
garden-version: ${{ inputs.garden-version }}
|
args: --overwrite --remove
|
||||||
oasis-branch: ${{ inputs.oasis-branch }}
|
|
||||||
oasis-workspace: ${{ inputs.oasis-workspace }}
|
|
||||||
kubeconfig: ${{ env.OASIS_WORKFLOW_KUBECONFIG }}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue