install s3cmd package from package sources #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
# TODO: pick a version? | |
- uses: jakejarvis/hugo-build-action@master | |
with: | |
args: --minify | |
# so we can inspect what is being produced | |
- uses: actions/upload-artifact@master | |
with: | |
name: website | |
path: './public' | |
# upload to s3 | |
- name: Install s3cmd | |
run: | | |
apt-get update | |
apt-get 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 "host_base = fsn1.your-objectstorage.com" >> ~/.s3cfg | |
echo "host_bucket = %(bucket)s.fsn1.your-objectstorage.com" >> ~/.s3cfg | |
- name: Upload files to Hetzner S3 | |
run: | | |
s3cmd sync ./public ${{ secrets.S3_BUCKET }} --delete-removed |