Skip to content

Merge pull request #17 from fastly/update-dependencies-cdn #31

Merge pull request #17 from fastly/update-dependencies-cdn

Merge pull request #17 from fastly/update-dependencies-cdn #31

name: CI / CD
# Controls when the action will run.
on:
# Triggers the workflow on push for the fastly-cdn branch
push:
branches: [ fastly-cdn ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-west-2'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Install dependencies
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: "Build Site"
run: bundle exec jekyll build
env:
JEKYLL_ENV: production
- name: "Deploy to AWS S3"
run: aws s3 sync ./_site/ s3://${{ secrets.AWS_S3_BUCKET_NAME }} --delete
- name: "Purge Fastly cache"
run: |
curl -X POST -H "Fastly-Key: ${{ secrets.FASTLY_KEY }}" "https://api.fastly.com/service/${{ secrets.FASTLY_SERVICE }}/purge_all"