Skip to content

Commit

Permalink
Adding automation for deploing to S3
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlovelltroy committed Apr 30, 2024
1 parent a7dc08c commit 9f2907c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/S3_Deploy_Hugo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Hugo Deploy To S3

on:
push:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out main
uses: actions/checkout@master
- name: Setup Node.js environment
uses: actions/[email protected]
- name: NPM Install
run: npm install
- name: Build Hugo
run: npm run build
- name: Deploy to S3
run: npm run deploy

11 changes: 11 additions & 0 deletions config/_default/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,14 @@ copyRight = "Copyright (c) 2023-2024 OpenCHAMI"
hint = "photo"
quality = 85
resampleFilter = "Lanczos"

[deployment]

[[deployment.targets]]

name = "aws-deployment"

# S3; see https://gocloud.dev/howto/blob/#s3
# For S3-compatible endpoints, see https://gocloud.dev/howto/blob/#s3-compatible
URL = "s3://ochami-web?region=us-west-1"
cloudFrontDistributionID = "E291GL86ZMAEXB"
4 changes: 2 additions & 2 deletions config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mainSections = ["docs", "events"]

# Navbar
navbarSticky = true # true (default) or false
containerBreakpoint = "fluid" # "", "sm", "md", "lg" (default), "xl", "xxl", or "fluid"
containerBreakpoint = "xl" # "", "sm", "md", "lg" (default), "xl", "xxl", or "fluid"

## Button
navBarButton = false # false (default) or true
Expand Down Expand Up @@ -74,7 +74,7 @@ mainSections = ["docs", "events"]
editPage = true # false (default) or true
lastMod = false # false (default) or true
repoHost = "GitHub" # GitHub (default), Gitea, GitLab, Bitbucket, or BitbucketServer
docsRepo = "https://github.com/OpenCHAMI/openchami.org-test"
docsRepo = "https://github.com/OpenCHAMI/openchami.org"
docsRepoBranch = "main" # main (default), master, or <branch name>
docsRepoSubPath = "" # "" (none, default) or <sub path>

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"preinfo": "npm version",
"info": "npm list",
"postinfo": "exec-bin node_modules/.bin/hugo/hugo version",
"postinstall": "hugo-installer --version otherDependencies.hugo --extended --destination node_modules/.bin/hugo"
"postinstall": "hugo-installer --version otherDependencies.hugo --extended --destination node_modules/.bin/hugo",
"deploy": "npm run build && exec-bin node_modules/.bin/hugo/hugo deploy --maxDeletes -1"
},
"dependencies": {
"@hyas/doks-core": "^1.4.1",
Expand Down

0 comments on commit 9f2907c

Please sign in to comment.