Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/middleman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Middleman Build

on:
push: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
id-token: write # needed for configure-aws-credentials
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::689053117832:role/gamewrap_deploy

- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
node-version-file: ".node-version"

- name: Install JS dependencies
run: npm install --legacy-peer-deps

- name: Build Middleman site
run: bundle exec middleman build

- name: Deploy to S3
if: github.event.ref == 'refs/heads/main'
run: aws s3 sync ./build/ s3://gamewrap.interactiveliterature.org/ --delete --acl public-read
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ gem "wdm", "~> 0.1.0", platforms: %i[mswin mingw]
gem "tzinfo-data", platforms: %i[mswin mingw jruby]

gem "middleman-autoprefixer"
gem "middleman-s3_sync", github: "fredjean/middleman-s3_sync"
gem "middleman-cdn"
# gem "middleman-s3_sync", github: "fredjean/middleman-s3_sync"
# gem "middleman-cdn"

gem "sass"
gem "bootstrap-sass"
Expand Down
93 changes: 0 additions & 93 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
GIT
remote: https://github.com/fredjean/middleman-s3_sync.git
revision: 39c3b84aafadbc8496f8fd8a139ef0117cfba62a
specs:
middleman-s3_sync (4.0.3)
ansi (~> 1.5.0)
fog-aws (>= 0.1.1)
map
middleman-cli
middleman-core (>= 4.0.0)
mime-types (~> 3.1)
parallel
ruby-progressbar
unf

GEM
remote: https://rubygems.org/
specs:
Expand All @@ -31,7 +16,6 @@ GEM
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ansi (1.5.0)
autoprefixer-rails (10.4.19.0)
execjs (~> 2)
aws-eventstream (1.3.2)
Expand All @@ -54,9 +38,6 @@ GEM
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
builder (3.3.0)
cloudflare (3.2.1)
rest-client (~> 2.0.2)
coderay (1.1.3)
coffee-script (2.4.1)
coffee-script-source
Expand All @@ -66,64 +47,28 @@ GEM
connection_pool (2.5.0)
contracts (0.17.2)
csv (3.3.2)
domain_name (0.6.20240107)
dotenv (3.1.7)
drb (2.2.1)
erubi (1.13.1)
excon (0.112.0)
execjs (2.10.0)
faraday (0.17.6)
multipart-post (>= 1.2, < 3)
fast_blank (1.0.1)
fastimage (2.4.0)
fastly (1.15.0)
ffi (1.17.1)
fog-aws (1.4.1)
fog-core (~> 1.38)
fog-json (~> 1.0)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
fog-core (1.45.0)
builder
excon (~> 0.58)
formatador (~> 0.2)
fog-json (1.2.0)
fog-core
multi_json (~> 1.10)
fog-xml (0.1.5)
fog-core
nokogiri (>= 1.5.11, < 2.0.0)
formatador (0.3.0)
haml (5.2.2)
temple (>= 0.8.0)
tilt
hamster (3.0.0)
concurrent-ruby (~> 1.0)
hashie (5.0.0)
http-cookie (1.0.8)
domain_name (~> 0.5)
httparty (0.22.0)
csv
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
ipaddress (0.8.3)
jmespath (1.6.2)
jwt (2.10.1)
base64
kramdown (2.5.1)
rexml (>= 3.3.9)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.6)
map (6.6.0)
maxcdn (0.4.0)
addressable (~> 2.4)
faraday (~> 0.9)
net-http-persistent (~> 2.9)
signet (~> 0.7)
memoist (0.16.2)
method_source (1.1.0)
middleman (4.6.0)
Expand All @@ -132,15 +77,6 @@ GEM
middleman-autoprefixer (3.0.0)
autoprefixer-rails (~> 10.0)
middleman-core (>= 4.0.0)
middleman-cdn (0.3.2)
activesupport (>= 4.1)
ansi (~> 1.5)
cloudflare (~> 3.2.1)
fastly (~> 1.1)
fog-aws (~> 1.4)
httparty (~> 0.13)
maxcdn (~> 0.1)
middleman (>= 3.2)
middleman-cli (4.6.0)
thor (>= 0.17.0, < 1.3.0)
middleman-core (4.6.0)
Expand Down Expand Up @@ -171,23 +107,8 @@ GEM
toml
uglifier (>= 3, < 5)
webrick
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2025.0304)
mini_mime (1.1.5)
mini_portile2 (2.8.8)
minitest (5.25.5)
multi_json (1.15.0)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
multipart-post (2.4.1)
mutex_m (0.3.0)
net-http-persistent (2.9.4)
netrc (0.11.0)
nokogiri (1.18.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
padrino-helpers (0.15.3)
i18n (>= 0.6.7, < 2)
padrino-support (= 0.15.3)
Expand All @@ -199,20 +120,14 @@ GEM
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (6.0.1)
racc (1.8.1)
rack (3.1.12)
rackup (2.2.1)
rack (>= 3)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
redcarpet (3.3.4)
rest-client (2.0.2)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.4.1)
ruby-progressbar (1.13.0)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
Expand All @@ -222,11 +137,6 @@ GEM
ffi (~> 1.9)
securerandom (0.4.1)
servolux (0.13.0)
signet (0.19.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
temple (0.10.3)
thor (1.2.2)
tilt (2.6.0)
Expand All @@ -236,7 +146,6 @@ GEM
concurrent-ruby (~> 1.0)
uglifier (4.2.1)
execjs (>= 0.3.0, < 3)
unf (0.2.0)
uri (1.0.3)
webrick (1.9.1)

Expand All @@ -253,8 +162,6 @@ DEPENDENCIES
haml (~> 5.0)
middleman (~> 4.6.0)
middleman-autoprefixer
middleman-cdn
middleman-s3_sync!
mutex_m
pry
redcarpet (~> 3.3.0)
Expand Down
38 changes: 19 additions & 19 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,23 @@ def navbar_item(text_or_url, url = nil, &block)
# set :http_prefix, "/Content/images/"
end

aws_creds = Aws::SharedCredentials.new(profile_name: "neil").credentials

activate :s3_sync do |s3_sync|
s3_sync.bucket = "gamewrap.interactiveliterature.org" # The name of the S3 bucket you are targeting. This is globally unique.
s3_sync.region = "us-east-1" # The AWS region for your bucket.
s3_sync.aws_access_key_id = aws_creds.access_key_id
s3_sync.aws_secret_access_key = aws_creds.secret_access_key
s3_sync.path_style = true
s3_sync.index_document = "index.html"
s3_sync.error_document = "error.html"
end
# aws_creds = Aws::SharedCredentials.new(profile_name: "neil").credentials

# activate :s3_sync do |s3_sync|
# s3_sync.bucket = "gamewrap.interactiveliterature.org" # The name of the S3 bucket you are targeting. This is globally unique.
# s3_sync.region = "us-east-1" # The AWS region for your bucket.
# s3_sync.aws_access_key_id = aws_creds.access_key_id
# s3_sync.aws_secret_access_key = aws_creds.secret_access_key
# s3_sync.path_style = true
# s3_sync.index_document = "index.html"
# s3_sync.error_document = "error.html"
# end

activate :cdn do |cdn|
cdn.cloudfront = {
access_key_id: aws_creds.access_key_id,
secret_access_key: aws_creds.secret_access_key,
distribution_id: "E54CA6RGBP7HW"
}
cdn.after_build = true
end
# activate :cdn do |cdn|
# cdn.cloudfront = {
# access_key_id: aws_creds.access_key_id,
# secret_access_key: aws_creds.secret_access_key,
# distribution_id: "E54CA6RGBP7HW"
# }
# cdn.after_build = true
# end