Compare commits
22 commits
ep/Apr6-20
...
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 | |||
![]() |
3dbcf39ece |
2 changed files with 84 additions and 1 deletions
39
README.md
39
README.md
|
@ -1,3 +1,40 @@
|
|||
# Elysium Actions
|
||||
## About
|
||||
The actions are used by Elysium to run CI/CD tasks and this repo will be archived once Gitea supports private actions (See issue [Here](https://github.com/go-gitea/gitea/issues/24621) )
|
||||
The actions are used by Elysium to run CI/CD tasks and this repo will be archived once Gitea supports private actions (See issue [Here](https://github.com/go-gitea/gitea/issues/24621))
|
||||
|
||||
## Actions
|
||||
|
||||
The actions available are:
|
||||
- [S3 Backup](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/s3-backup/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)
|
||||
- [Elysium CI/CD](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/elysium-ci-cd/action.yml)
|
||||
|
||||
## Workflow Template
|
||||
|
||||
The example below demonstrates how to use the [oasis-deploy](https://gitea.dunemask.dev/elysium/elysium-actions/src/branch/oasis-deploy/action.yml) action.
|
||||
|
||||
```yml
|
||||
name: Deploy Edge
|
||||
run-name: ${{ gitea.actor }} Deploy Edge
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.ELYSIUM_ORG_READ_TOKEN }}
|
||||
KUBECONFIG_BASE64: ${{ secrets.KUBECONFIG_USW_EDGE }}
|
||||
GARDEN_DEPLOY_ACTION: nile
|
||||
|
||||
jobs:
|
||||
deploy-edge:
|
||||
steps:
|
||||
- name: Oasis Setup
|
||||
uses: https://gitea.dunemask.dev/elysium/elysium-actions@oasis-deploy
|
||||
with:
|
||||
gitea-token: ${{ env.GITEA_TOKEN }}
|
||||
kubeconfig: ${{ env.KUBECONFIG_BASE64 }}
|
||||
- name: Deploy to Edge env
|
||||
run: garden deploy $GARDEN_DEPLOY_ACTION --force --force-build --env usw-edge
|
||||
working-directory: ${{ env.OASIS_WORKSPACE }}
|
||||
```
|
||||
|
|
46
action.yml
Normal file
46
action.yml
Normal file
|
@ -0,0 +1,46 @@
|
|||
name: "S3 Backup Action"
|
||||
description: "Backup to S3 Bucket"
|
||||
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 }}
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
# Checkout Repository
|
||||
- name: Checkout Repository
|
||||
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
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue