Publish artifacts to AWS

This commit is contained in:
Zephyr Lykos 2023-07-22 14:53:06 +08:00
parent 4255a7baeb
commit bb7cbe362d
No known key found for this signature in database
GPG Key ID: 697CA71D6669DCF1
2 changed files with 9 additions and 3 deletions

View File

@ -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 }}

View File

@ -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 '..'