Add GitHub Actions workflows for build and deployment
- Add build.yml: builds Hugo site on all non-main branches and PRs - Add deploy.yml: builds and deploys to S3 + CloudFront on main branch pushes - Uses generic OIDC role for AWS authentication
This commit is contained in:
parent
95b37f1bef
commit
21ce49b769
2 changed files with 89 additions and 0 deletions
36
.github/workflows/build.yml
vendored
Normal file
36
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
name: Build Site
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
extended: true
|
||||
|
||||
- name: Build Hugo site
|
||||
run: hugo --minify
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: hugo-build
|
||||
path: public/
|
||||
retention-days: 7
|
Loading…
Add table
Add a link
Reference in a new issue