blog/.forgejo/workflows/deploy.yml

38 lines
1 KiB
YAML
Raw Normal View History

2024-04-29 17:18:42 +00:00
name: Deploy pages
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2024-04-29 17:20:20 +00:00
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.x"
2024-05-02 16:34:57 +00:00
- uses: https://code.icb4dc0.de/prskr/setup-hugo@main
2024-04-29 17:31:56 +00:00
with:
2024-05-02 16:34:57 +00:00
dart-sass: true
2024-11-28 12:29:08 +00:00
extended: true
2024-04-29 17:31:56 +00:00
- uses: actions/cache@v4
with:
path: /home/runner/.cache/hugo_cache
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugomod-
2024-11-28 12:29:08 +00:00
- name: Build
2024-04-29 17:20:20 +00:00
run: |
hugo mod get
hugo --minify --environment production
2024-11-28 12:29:08 +00:00
- name: Copy files to the s3 website content bucket
run: aws s3 sync public s3://${{ secrets.HCLOUD_BUCKET }} --delete
2024-05-07 16:19:49 +00:00
env:
2024-11-26 21:12:59 +00:00
AWS_ACCESS_KEY_ID: ${{ secrets.HCLOUD_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.HCLOUD_SECRET_KEY }}
2024-11-28 12:29:08 +00:00
AWS_DEFAULT_REGION: fsn1
AWS_ENDPOINT_URL: ${{ secrets.HCLOUD_ENDPOINT }}