From 9f2907c5e296faa8a621d0d07b035903b3a6ca92 Mon Sep 17 00:00:00 2001 From: Alex Lovell-Troy Date: Tue, 30 Apr 2024 13:08:01 -0400 Subject: [PATCH] Adding automation for deploing to S3 --- .github/workflows/S3_Deploy_Hugo.yml | 21 +++++++++++++++++++++ config/_default/hugo.toml | 11 +++++++++++ config/_default/params.toml | 4 ++-- package.json | 3 ++- 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/S3_Deploy_Hugo.yml diff --git a/.github/workflows/S3_Deploy_Hugo.yml b/.github/workflows/S3_Deploy_Hugo.yml new file mode 100644 index 0000000..7faafc0 --- /dev/null +++ b/.github/workflows/S3_Deploy_Hugo.yml @@ -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/setup-node@v4.0.2 + - name: NPM Install + run: npm install + - name: Build Hugo + run: npm run build + - name: Deploy to S3 + run: npm run deploy + diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index b9f9fe6..9bc4a06 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -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" diff --git a/config/_default/params.toml b/config/_default/params.toml index e7a1338..fdda8bc 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -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 @@ -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 docsRepoSubPath = "" # "" (none, default) or diff --git a/package.json b/package.json index 386e6b2..ff87467 100644 --- a/package.json +++ b/package.json @@ -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",