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