Skip to content

Topics for 2025

Topics for 2025 #78

name: blog
on:
workflow_dispatch:
push:
paths:
- "sites/blog.mads-hartmann.com/**"
jobs:
build:
name: Build and deploy
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
working-directory: sites/blog.mads-hartmann.com
ruby-version: "3.1"
bundler-cache: true
- name: Install dependencies
working-directory: sites/blog.mads-hartmann.com
run: bundle install
- name: Build
working-directory: sites/blog.mads-hartmann.com
run: bundle exec jekyll build --source src
- name: Upload to S3 and invalidate cache
if: github.ref == 'refs/heads/main'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.BLOG_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.BLOG_AWS_SECRET_ACCESS_KEY }}
working-directory: sites/blog.mads-hartmann.com
run: |
aws s3 sync --region us-east-1 _site/ s3://${{ secrets.BLOG_BUCKET_NAME }}/
aws cloudfront create-invalidation --region us-east-1 --distribution-id ${{ secrets.BLOG_CLOUDFRONT_DISTRIBUTION_ID }} --paths '/*'