Skip to content

Commit

Permalink
add s3 endpoint url, first post draft, buildspec for AWS CodeBuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Hessu committed Jan 30, 2020
1 parent d791b18 commit 205b7df
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 5 deletions.
20 changes: 20 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 0.2

env:
variables:
s3_output: "blog.gonzague.pagin"
hugo_version: "0.63.2"

phases:
install:
commands:
- wget "https://github.com/gohugoio/hugo/releases/download/v${hugo_version}/hugo_${hugo_version}_Linux-64bit.deb"
- sudo dpkg -i hugo_${hugo_version}_Linux-64bit.deb
finally:
- hugo version
build:
commands:
- hugo
- cd public && aws s3 sync . s3:https://${s3_output} --delete --acl public-read
finally:
- echo "Script finished running"
55 changes: 52 additions & 3 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
baseURL = "http:https://example.org/"
languageCode = "en-us"
baseURL = "http:https://blog.gonzague.pagin.s3-website.eu-west-3.amazonaws.com/"
languageCode = "fr-FR"
title = "My New Hugo Site"
theme = "hyde"

Expand All @@ -10,4 +10,53 @@ theme = "hyde"
]

[params]
description = "Your custom description"
description = "Your custom description"

[deployment]
# By default, files are uploaded in an arbitrary order.
# Files that match the regular expressions in the "Order" list
# will be uploaded first, in the listed order.
order = [".jpg$", ".gif$"]


[[deployment.targets]]
# An arbitrary name for this target.
name = "mydeployment"
# The Go Cloud Development Kit URL to deploy to. Examples:
# GCS; see https://gocloud.dev/howto/blob/#gcs
# URL = "gs:https://<Bucket Name>"

# S3; see https://gocloud.dev/howto/blob/#s3
# For S3-compatible endpoints, see https://gocloud.dev/howto/blob/#s3-compatible
URL = "s3:https://blog.gonzague.pagin?region=eu-west-3"

# Azure Blob Storage; see https://gocloud.dev/howto/blob/#azure
# URL = "azblob:https://$web"

# You can use a "prefix=" query parameter to target a subfolder of the bucket:
# URL = "gs:https://<Bucket Name>?prefix=a/subfolder/"

# If you are using a CloudFront CDN, deploy will invalidate the cache as needed.
# cloudFrontDistributionID = <ID>


# ... add more [[deployment.targets]] sections ...


# [[deployment.matchers]] configure behavior for files that match the Pattern.
# Samples:

[[deployment.matchers]]
# Cache static assets for 1 year.
pattern = "^.+\\.(js|css|svg|ttf)$"
cacheControl = "max-age=31536000, no-transform, public"
gzip = true

[[deployment.matchers]]
pattern = "^.+\\.(png|jpg)$"
cacheControl = "max-age=31536000, no-transform, public"
gzip = false

[[deployment.matchers]]
pattern = "^.+\\.(html|xml|json)$"
gzip = true
8 changes: 8 additions & 0 deletions content/posts/how-this-blog-is-made.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "How This Blog Is Made"
date: 2020-01-30T17:30:58+01:00
draft: true
---

I wanted something simple, using github and aws, a simple workflow : write then push

4 changes: 2 additions & 2 deletions content/posts/my-first-post.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "My First Post"
date: 2020-01-30T17:14:05+01:00
draft: true
draft: false
---

Hello world!

Deployed from pipeline

0 comments on commit 205b7df

Please sign in to comment.