feat: update news #131
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: CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4 # v1.127.0 | |
with: | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
cache-version: 0 # Increment this number if you need to re-download cached gems | |
- name: Build with Jekyll | |
run: bundle exec jekyll build | |
env: | |
JEKYLL_ENV: production | |
- name: Archive Jekyll build | |
if: github.ref == 'refs/heads/master' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: site | |
path: ./_site | |
retention-days: 3 | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
concurrency: deploy_to_s3 | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download Jekyll build | |
uses: actions/download-artifact@v3 | |
with: | |
name: site | |
path: ./_site | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4 # v1.127.0 | |
with: | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
cache-version: 0 # Increment this number if you need to re-download cached gems | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
- name: Install s3_website | |
run: bundle exec s3_website install | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: ${{ vars.AWS_DEPLOY_ROLE_ARN }} | |
aws-region: us-east-1 | |
- name: Run s3_website | |
run: java -cp $(bundle show s3_website)/*.jar s3.website.Push | |
env: | |
S3_BUCKET: ${{ vars.S3_BUCKET }} | |
- name: Purge Cloudflare cache | |
run: | | |
curl \ | |
-X POST "https://api.cloudflare.com/client/v4/zones/${CF_ZONE_ID}/purge_cache" \ | |
-H "Authorization: Bearer ${CF_API_TOKEN}" \ | |
-H "Content-Type: application/json" \ | |
--data '{"purge_everything":true}' | |
env: | |
CF_ZONE_ID: ${{ vars.CF_ZONE_ID }} | |
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |