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-08-24 21:58:18 -06:00
|
|
|
s3-backup-path:
|
2024-02-13 16:49:46 -07:00
|
|
|
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
|
2024-08-24 22:23:09 -06:00
|
|
|
- name: Checkout Repository
|
2024-08-25 16:33:09 -06:00
|
|
|
uses: actions/checkout@v3
|
2024-08-24 22:23:09 -06:00
|
|
|
with:
|
2024-08-25 16:34:47 -06:00
|
|
|
path: repo
|
2024-02-15 19:09:47 -07:00
|
|
|
# Load Backup Envars
|
2024-08-24 22:16:52 -06:00
|
|
|
- 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
|
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-08-24 22:23:09 -06:00
|
|
|
- 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 }}
|
2024-08-25 16:34:47 -06:00
|
|
|
MIRROR_SOURCE: repo
|
2024-08-24 22:23:09 -06:00
|
|
|
with:
|
|
|
|
args: --overwrite --remove
|