-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (32 loc) · 999 Bytes
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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: |
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 "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