Skip to content

Instantly share code, notes, and snippets.

@roylines
Created September 5, 2021 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roylines/13646e3ce05646a63ce86ea726a8e11b to your computer and use it in GitHub Desktop.
Save roylines/13646e3ce05646a63ce86ea726a8e11b to your computer and use it in GitHub Desktop.
github action: jekyll
name: jekyll
on:
push:
paths:
- 'jekyll/**'
- '.github/workflows/jekyll.yml'
jobs:
jekyll:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
JEKYLL_ENV: production
defaults:
run:
working-directory: jekyll
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
working-directory: jekyll
ruby-version: 2.7
bundler-cache: true
- run: bundle exec jekyll build
- if: github.ref == 'refs/heads/main'
run: aws s3 sync ./_site/ s3://xyz.io --size-only --delete --cache-control max-age=604800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment