From b825d865d2632c088b166250d1ca3fe18bde3779 Mon Sep 17 00:00:00 2001 From: Lukas Langrock Date: Wed, 24 Jul 2024 23:51:16 +0200 Subject: [PATCH] Upload index to bucket directly (#1) Instead of just creating the file and uploading it to Gitea via workflow, why not upload it directly to the bucket that is meant for? Exactly, so that's what changed. Reviewed-on: https://git.libre.moe/lukas/b2_make_index/pulls/1 --- .gitea/workflows/build_index.yml | 6 +----- script.py | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build_index.yml b/.gitea/workflows/build_index.yml index 494de96..a5cb878 100644 --- a/.gitea/workflows/build_index.yml +++ b/.gitea/workflows/build_index.yml @@ -18,8 +18,4 @@ jobs: APPLICATION_KEY_ID: ${{ secrets.APPLICATION_KEY_ID }} BUCKET_NAME: ${{ vars.BUCKET_NAME }} BASE_URL: ${{ vars.BASE_URL }} - run: python3 script.py - - name: Upload build artifacts - uses: christopherhx/gitea-upload-artifact@v4 - with: - path: index.html \ No newline at end of file + run: python3 script.py \ No newline at end of file diff --git a/script.py b/script.py index 7a3e1af..e26f942 100644 --- a/script.py +++ b/script.py @@ -60,5 +60,6 @@ output_file = 'index.html' with open(output_file, 'w') as f: f.write(html_content) -print(f"HTML file '{output_file}' has been created with links to all files in the bucket.") +# Upload file to bucket +bucket.upload_local_file(local_file=output_file, file_name="index.html")