Skip to content

Commit

Permalink
Add workflow for deploying the site
Browse files Browse the repository at this point in the history
  • Loading branch information
tcdowney committed Feb 11, 2024
1 parent b03d2ca commit 1c3986f
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-jekyll-env-image.yml
Expand Up @@ -6,6 +6,7 @@ on:
- 'main'
paths:
- 'Dockerfile'
workflow_dispatch:

jobs:
build:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
@@ -0,0 +1,29 @@
name: Build Jekyll Env Image

on:
push:
branches:
- 'main'
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
container:
image: downey/jekyll-env:latest
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
env:
JEKYLL_ENV: production
S3_ID: ${{ secrets.S3_ID }}
S3_SECRET: ${{ secrets.S3_SECRET }}
BLOG_S3_BUCKET: ${{ secrets.BLOG_S3_BUCKET }}
BLOG_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.BLOG_CLOUDFRONT_DISTRIBUTION_ID }}
PHOTO_S3_BUCKET: ${{ secrets.PHOTO_S3_BUCKET }}
PHOTO_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.PHOTO_CLOUDFRONT_DISTRIBUTION_ID }}
steps:
- name: Deploy Blog
run: rake deploy:blog
- name: Deploy Photos
run: rake deploy:photo
4 changes: 2 additions & 2 deletions .gitignore
@@ -1,10 +1,10 @@
_site/
s3_website.yml
google*
.DS_Store
.sass-cache
.asset-cache
.idea/*
.vscode/*
blog/.jekyll-cache/
photo/.jekyll-cache/
photo/.jekyll-cache/
.env
1 change: 1 addition & 0 deletions blog/_config.yml
Expand Up @@ -20,6 +20,7 @@ permalink: "blog/:title/"

exclude:
- s3_website.yml
- .env
plugins:
- jekyll-sitemap
- jekyll-redirect-from
Expand Down
13 changes: 13 additions & 0 deletions blog/s3_website.yml
@@ -0,0 +1,13 @@
s3_id: <%= ENV['S3_ID'] %>
s3_secret: <%= ENV['S3_SECRET'] %>
s3_bucket: <%= ENV['BLOG_S3_BUCKET'] %>
cloudfront_distribution_id: <%= ENV['BLOG_CLOUDFRONT_DISTRIBUTION_ID'] %>
cloudfront_wildcard_invalidation: true

gzip: true
gzip:
- .html
- .css
- .md
redirects:
index.html: /blog
1 change: 1 addition & 0 deletions photo/_config.yml
Expand Up @@ -16,6 +16,7 @@ permalink: photos/:year/:month/:day/:title.html

exclude:
- s3_website.yml
- .env
plugins:
- jekyll-sitemap
- jekyll-paginate
Expand Down
11 changes: 11 additions & 0 deletions photo/s3_website.yml
@@ -0,0 +1,11 @@
s3_id: <%= ENV['S3_ID'] %>
s3_secret: <%= ENV['S3_SECRET'] %>
s3_bucket: <%= ENV['PHOTO_S3_BUCKET'] %>
cloudfront_distribution_id: <%= ENV['PHOTO_CLOUDFRONT_DISTRIBUTION_ID'] %>
cloudfront_wildcard_invalidation: true

gzip: true
gzip:
- .html
- .css
- .md

0 comments on commit 1c3986f

Please sign in to comment.