elysium-actions/action.yml

47 lines
1.6 KiB
YAML
Raw Normal View History

2024-02-13 16:49:46 -07:00
name: "S3 Backup Action"
description: "Backup to S3 Bucket"
inputs:
2024-02-15 19:09:47 -07:00
infisical-token:
description: Infisical token for backup envars
required: true
2024-08-24 21:50:30 -06:00
infisical-project:
description: Infisical Project
required: true
2024-02-13 16:49:46 -07:00
s3-backup-path:
description: "Workspace to setup Oasis"
required: false
2024-08-24 21:47:25 -06:00
default: backups/forgejo-repositories/${{ forgejo.repository }}
2024-02-13 16:49:46 -07:00
runs:
using: "composite"
steps:
# Checkout Repository
- name: Checkout Repository
uses: actions/checkout@v3
with:
2024-08-24 21:47:25 -06:00
path: ${{ forgejo.workspace }}/repo
2024-02-15 19:09:47 -07:00
# Load Backup Envars
- name: Setup Backup Envars
2024-08-24 21:47:25 -06:00
uses: https://forgejo.dunemask.dev/elysium/elysium-actions@infisical-env
2024-02-15 19:09:47 -07:00
with:
infisical-token: ${{ inputs.infisical-token }}
2024-08-24 21:50:30 -06:00
project-id: ${{ inputs.infisical-project }}
2024-02-15 19:09:47 -07:00
secret-envs: edge
2024-08-24 21:47:25 -06:00
secret-paths: /devops/forgejo-backups
2024-02-15 19:26:49 -07:00
# Fix Envar Format
2024-02-15 19:25:45 -07:00
- name: Fix Env Format
run: |
2024-08-24 21:47:25 -06:00
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
2024-02-15 19:26:49 -07:00
# Backup Repository
2024-02-13 16:49:46 -07:00
- name: S3 Backup
2024-08-24 21:56:30 -06:00
uses: https://github.com/peter-evans/s3-backup@v1
2024-02-13 16:49:46 -07:00
env:
2024-02-15 19:24:18 -07:00
STORAGE_SERVICE_URL: ${{ env.BACKUP_S3_ENDPOINT }}
2024-02-15 19:25:45 -07:00
ACCESS_KEY_ID: ${{ env.BACKUP_S3_KEY_ID }}
SECRET_ACCESS_KEY: ${{ env.BACKUP_S3_KEY }}
2024-02-13 16:49:46 -07:00
MIRROR_TARGET: ${{ inputs.s3-backup-path }}
2024-08-24 21:47:25 -06:00
MIRROR_SOURCE: ${{ forgejo.workspace }}/repo
2024-02-13 16:49:46 -07:00
with:
args: --overwrite --remove