Add The Ruby on Rails Performance Apocrypha to JA #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- uses: actions/checkout@master | |
- uses: ruby/setup-ruby@master | |
with: | |
ruby-version: '3.1' | |
- uses: r-lib/actions/setup-pandoc@v2 | |
with: | |
pandoc-version: '2.9.2.1' # The pandoc version to download (if necessary) and use. | |
- uses: actions/cache@master | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-gems- | |
- uses: bahmutov/npm-install@v1 | |
- name: Bundle install | |
run: | | |
bundle config path vendor/bundle | |
bundle install --jobs 4 --retry 3 | |
- name: make site | |
run: make | |
- name: deploy to S3 | |
uses: jakejarvis/s3-sync-action@master | |
if: contains(github.ref, 'main') | |
with: | |
args: --acl public-read --follow-symlinks --delete | |
env: | |
AWS_S3_BUCKET: 'www.speedshop.co.jp' | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: 'ap-northeast-1' | |
SOURCE_DIR: '_site' | |
- name: Cloudflare Purge Cache | |
uses: jakejarvis/cloudflare-purge-action@v0.3.0 | |
if: contains(github.ref, 'main') | |
env: | |
# Zone is required by both authentication methods | |
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} | |
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} |