/p/72: Be the first NOT to envy TUNA's SSD #893
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 | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: {} | |
repository_dispatch: {} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
SSH_KEY_E: ${{ secrets.SSH_KEY_E }} | |
LSI: 'true' | |
TZ: Etc/UTC | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2' | |
- name: Setup cache for Bundler | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
Gemfile.lock | |
vendor/bundle | |
key: ${{ runner.os }}-bundler-2-${{ hashFiles('Gemfile') }} | |
restore-keys: | | |
${{ runner.os }}-bundler-2- | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Setup cache for Node.js | |
id: cache-npm | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-npm-${{ hashFiles('package.json') }} | |
- name: Install - Bundler | |
env: | |
MAKE: make -j2 | |
run: | | |
bundle config set path vendor/bundle | |
bundle install --jobs=4 --retry=3 | |
bundle clean | |
- name: Install - NPM | |
if: steps.cache-npm.outputs.cache-hit != 'true' | |
run: | | |
npm install --also=dev | |
- name: Prepare build | |
run: bash script/prepare.sh | |
- name: Build site | |
run: bundle exec jekyll build --trace --profile --lsi | |
env: | |
JEKYLL_ENV: production | |
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update Algolia index | |
run: bundle exec jekyll algolia push | |
env: | |
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | |
continue-on-error: true | |
- name: Post-build patches | |
run: bash script/patch.sh | |
- name: Deploy to GitHub | |
run: script/deploy-actions.sh | |
continue-on-error: true | |
- name: Prepare for Cloudflare Pages | |
run: ${{ github.workspace }}/script/prepare-cloudflare.sh | |
working-directory: _site | |
- name: Deploy to Cloudflare Pages | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
accountId: ${{ secrets.CF_ACCOUNT_ID }} | |
command: pages deploy _site --project-name=ibug-web |