~franz/f-a.nz

32b0ad323acd36ccb5e0340283d8222a020250e1 — Franz Geffke 2 years ago 7d05ee8
added ci automation, cleanup
6 files changed, 67 insertions(+), 68 deletions(-)

M .gitignore
A .gitlab-ci.yml
M Gemfile
M _config.yml
M package.json
M s3_website.yml
M .gitignore => .gitignore +5 -2
@@ 1,6 1,9 @@
.DS_Store
_site
.sass-cache
.asset-cache
.jekyll-metadata
.DS_Store
node_modules
yarn.lock
package-lock.json
Gemfile.lock
.asset-cache

A .gitlab-ci.yml => .gitlab-ci.yml +33 -0
@@ 0,0 1,33 @@
image: franzos/ruby-node-gulp-java

cache:
  paths:
    - vendor/

before_script:
  - bundle install --path vendor

stages:
  - build
  - deploy

build:
  stage: build
  script:
    - yarn
    - gulp
    - JEKYLL_ENV=production bundle exec jekyll build -d public/
  artifacts:
    when: on_success
    paths:
      - public
    expire_in: 1h

deploy:
  stage: deploy
  script:
    - export AWS_ACCESS_KEY_ID="$(echo "$AWS_ACCESS_KEY_ID")"
    - export AWS_SECRET_ACCESS_KEY="$(echo "$AWS_SECRET_ACCESS_KEY")"
    - bundle exec s3_website push
  only:
    - master

M Gemfile => Gemfile +2 -13
@@ 8,23 8,12 @@ ruby RUBY_VERSION
#     bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.

# Happy Jekylling!
gem "jekyll"

# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima"

# Asset pipeline https://github.com/jekyll/jekyll-assets
gem "jekyll"
gem "jekyll-assets"

gem "jekyll-paginate-v2"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins

# If you have any plugins, put them here!
group :jekyll_plugins do
   gem "jekyll-feed", "~> 0.6"
  gem "s3_website"
end

M _config.yml => _config.yml +8 -4
@@ 6,7 6,6 @@ bitcoin: 1MfbsSexrSb74ZDQPqMrKGzZhRubHZBkCB

# Build settings
markdown: kramdown
theme: minima

kramdown:
  input: GFM


@@ 22,15 21,20 @@ gems:
  - jekyll-assets
  - jekyll-paginate-v2

# Exclude from processing
exclude:
  - Gemfile
  - Gemfile.lock
  - yarn.lock
  - package.json
  - .gitignore
  - node_modules
  - vendor
  - s3_website.yml
  - .gitlab-ci.yml
  - gulpfile.js
  - package-lock.json
  - package.json
  - yarn.lock
  - src
  - README.md

collections:
- gist

M package.json => package.json +2 -2
@@ 2,8 2,8 @@
  "name": "f-a.nz",
  "version": "1.0.0",
  "main": "index.js",
  "repository": "https://github.com/franzos/f-a.nz",
  "author": "Franz Geffke <franz@dkkma.com>",
  "repository": "https://git.sedv.org/f-a.nz/website.git",
  "author": "Franz Geffke <m@f-a.nz>",
  "license": "MIT",
  "dependencies": {
    "accounting": "^0.4.1",

M s3_website.yml => s3_website.yml +17 -47
@@ 1,21 1,15 @@
# You can remove these two lines to have credentials read from
# the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY or
# ~/.aws/credentials.
profile: f-a
s3_bucket: f-a.nz
cloudfront_distribution_id: E3R5W4W4XMOPGW

# Below are examples of all the available configurations.
# See README for more detailed info on each of them.

# site: path-to-your-website

# index_document: index.html
# error_document: error.html
# profile: f-a
s3_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
s3_secret: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
s3_bucket: f-a.nz

# max_age:
#   "assets/*": 6000
#   "*": 300
site: public/
index_document: index.html
error_document: 404.html

gzip:
  - .html


@@ 24,42 18,18 @@ gzip:
  - .jpg
  - .js
  - .svg
# gzip_zopfli: true

# See http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region for valid endpoints
s3_endpoint: eu-central-1

ignore_on_server: s3_website.yml

# exclude_from_upload:
#   - those_folders_of_stuff
#   - i_wouldnt_want_to_upload

# s3_reduced_redundancy: true

# cloudfront_distribution_id:

# cloudfront_distribution_config:
#   default_cache_behavior:
#     min_TTL: <%= 60 * 60 * 24 %>
#   aliases:
#     quantity: 1
#     items:
#       CNAME: your.website.com
ignore_on_server:
  - s3_website.yml
  - node_modules
  - src
  - .gitignore
  - Gemfile
  - package.json
  - _config.yml
  - yarn-error.log

cloudfront_distribution_id: E3R5W4W4XMOPGW
cloudfront_invalidate_root: true

# concurrency_level: 5

# redirects:
#   index.php: /
#   about.php: about.html
#   music-files/promo.mp4: http://www.youtube.com/watch?v=dQw4w9WgXcQ

# routing_rules:
#   - condition:
#       key_prefix_equals: blog/some_path
#     redirect:
#       host_name: blog.example.com
#       replace_key_prefix_with: some_new_path/
#       http_redirect_code: 301