Skip to content

Commit

Permalink
use s3cmd for s3 upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Atomsoldat committed Dec 28, 2024
1 parent 3619bfb commit 630e8d3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ jobs:
name: website
path: './public'
# upload to s3
- name: Configure AWS CLI for Hetzner S3
- name: Install s3cmd
run: |
aws configure set aws_access_key_id ${{ secrets.S3_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.S3_SECRET_ACCESS_KEY }}
aws configure set s3.region 'fsn1'
aws configure set s3.host_base 'fsn1.your-objectstorage.com'
aws configure set s3.host_bucket '%(bucket)s.fsn1.your-objectstorage.com'
pip install s3cmd
- name: Configure s3cmd
run: |
echo "[default]" > ~/.s3cfg
echo "access_key = ${{ secrets.S3_KEY_ID }}" >> ~/.s3cfg
echo "secret_key = ${{ secrets.S3_SECRET_KEY }}" >> ~/.s3cfg
echo "endpoint_url = https://fsn1.your-objectstorage.com" >> ~/.s3cfg
echo "host_base = fsn1.storage.hetzner.com" >> ~/.s3cfg
echo "host_bucket = %(bucket)s.fsn1.storage.hetzner.com" >> ~/.s3cfg
echo "use_https = True" >> ~/.s3cfg
- name: Upload files to Hetzner S3
run: |
aws s3 sync ./public ${{ secrets.S3_BUCKET }} --delete
s3cmd sync ./public ${{ secrets.S3_BUCKET }} --delete

0 comments on commit 630e8d3

Please sign in to comment.