From 881621c35c5e07b2be7f041fabedcbb4f2fe88b5 Mon Sep 17 00:00:00 2001 From: Dunemask Date: Tue, 13 Feb 2024 16:49:46 -0700 Subject: [PATCH] [FEATURE] S3 Action --- action.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..72bc359 --- /dev/null +++ b/action.yml @@ -0,0 +1,41 @@ +name: "S3 Backup Action" +description: "Backup to S3 Bucket" +inputs: + s3-backup-endpoint: + description: "S3 Backup Endpoint" + required: false + default: ${{ secrets.S3_BACKUP_ENDPOINT }} + s3-backup-key-id: + description: "S3 Backup Access Key ID" + required: false + default: ${{ secrets.S3_BACKUP_KEY_ID}} + s3-backup-key: + description: "S3 Backup Access Key" + required: false + default: ${{ secrets.S3_BACKUP_KEY}} + s3-backup-path: + description: "Workspace to setup Oasis" + required: false + default: backups/gitea-repositories/${{ gitea.repository }} + repository-dir: + description: "Directory to clone the Repository to" + required: false + default: ${{ gitea.workspace }}/repo +runs: + using: "composite" + steps: + # Checkout Repository + - name: Checkout Repository + uses: actions/checkout@v3 + with: + path: ${{ inputs.repository-dir }} + - name: S3 Backup + uses: peter-evans/s3-backup@v1 + env: + STORAGE_SERVICE_URL: ${{ inputs.s3-backup-endpoint }} + ACCESS_KEY_ID: ${{ inputs.s3-backup-key-id }} + SECRET_ACCESS_KEY: ${{ inputs.s3-backup-key }} + MIRROR_TARGET: ${{ inputs.s3-backup-path }} + MIRROR_SOURCE: ${{ inputs.repository-dir }} + with: + args: --overwrite --remove