Compare commits

..

21 commits

Author SHA1 Message Date
bf54b80924 [CHORE] Adjust Actions 2024-08-25 16:36:30 -06:00
b8805d941b [CHORE] Adjust Actions 2024-08-25 16:35:42 -06:00
f3acd807bf [CHORE] Adjust Actions 2024-08-25 16:34:47 -06:00
181c35fac5 [CHORE] Adjust Actions 2024-08-25 16:33:09 -06:00
f4f89dad0d [CHORE] Adjust Action Trigger 2024-08-24 22:23:09 -06:00
f0038b6b69 [CHORE] Adjust Action Trigger 2024-08-24 22:17:52 -06:00
962ca38ff9 [CHORE] Adjust Action Trigger 2024-08-24 22:16:52 -06:00
ba73b418a8 [CHORE] Adjust Action Trigger 2024-08-24 22:15:51 -06:00
30096f817f [CHORE] Adjust Actions 2024-08-24 22:09:52 -06:00
bb8787fded [CHORE] Adjust Actions 2024-08-24 22:07:54 -06:00
1e3c32b3e7 [CHORE] Adjust Actions 2024-08-24 22:06:12 -06:00
75bd9ebc6d [CHORE] Adjust Actions 2024-08-24 22:02:57 -06:00
8fd38af4f8 [CHORE] Adjust Actions 2024-08-24 21:58:18 -06:00
8646f62cbe [CHORE] Adjust Actions 2024-08-24 21:56:30 -06:00
41d4305f3a [CHORE] Fix Endpoints & Forgejo Refs 2024-08-24 21:50:30 -06:00
2dc6d1bbd1 [CHORE] Fix Endpoints & Forgejo Refs 2024-08-24 21:47:25 -06:00
02ebb4634f [DOC] Normalized comments 2024-02-15 19:26:49 -07:00
4d55f5c1e7 [FIX] S3 Fix 2024-02-15 19:25:45 -07:00
7b513727bb [FEATURE] S3 Fix 2024-02-15 19:24:18 -07:00
26eff76d90 [FEATURE] Initial S3 Concept 2024-02-15 19:09:47 -07:00
881621c35c [FEATURE] S3 Action 2024-02-13 16:49:46 -07:00
2 changed files with 34 additions and 69 deletions

View file

@ -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

View file

@ -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 }}