From bb7cbe362d1daa45332074c310095e836d99b48c Mon Sep 17 00:00:00 2001 From: Zephyr Lykos Date: Sat, 22 Jul 2023 14:53:06 +0800 Subject: [PATCH] Publish artifacts to AWS --- .github/workflows/Publish.yml | 3 +++ publish.ps1 | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index 629de24..68261fa 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -41,3 +41,6 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN }} TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} diff --git a/publish.ps1 b/publish.ps1 index 982eff1..666a70d 100644 --- a/publish.ps1 +++ b/publish.ps1 @@ -12,9 +12,12 @@ git add . $shouldUpdate = git status -s if ($shouldUpdate) { - git commit -m "Publish" - git remote set-url origin "https://tadaf:$token@github.com/bs-community/plugins-dist.git" - git push origin master + if ($env:AWS_ACCESS_KEY_ID -and $env:AWS_SECRET_ACCESS_KEY -and $env:AWS_DEFAULT_REGION) { + aws s3 sync . s3://plugins-dist/ --exclude ".git/*" + } + git commit -m "Publish" + git remote set-url origin "https://tadaf:$token@github.com/bs-community/plugins-dist.git" + git push origin master } Set-Location '..'