Skip to content

Bump actions/upload-pages-artifact from 3 to 4 #2603

Bump actions/upload-pages-artifact from 3 to 4

Bump actions/upload-pages-artifact from 3 to 4 #2603

Workflow file for this run

name: Build
on:
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 5000
fetch-tags: false
- name: Set up ruby
uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
with:
ruby-version: 3.2.3
# git restore-mtime is currently broken in the GH Actions images so using our own updated local copy
# see https://github.com/MestreLion/git-tools/blob/main/git-restore-mtime
- name: Restore mtime
run: ./tools/git-restore-mtime
- name: Cache Ruby gems
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gems-
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Build Jekyll site
run: bundle exec jekyll build --future --config _config.yml,_only_latest_guides_config.yml
- name: Store PR id
run: echo ${{ github.event.number }} > ./_site/pr-id.txt
- name: Reduce the size of the website to be compatible with surge
run: |
find assets/images/posts/ -mindepth 1 -maxdepth 1 -type d -mtime +50 -exec rm -rf _site/{} \;
find newsletter/ -mindepth 1 -maxdepth 1 -type d -mtime +50 -exec rm -rf _site/{} \;
rm -rf _site/assets/stickers
rm -rf _site/assets/images/worldtour/2023
rm -rf _site/assets/images/worldtour/2024
rm -rf _site/assets/images/desktopwallpapers
rm -rf _site/assets/images/stickers
- name: Publishing directory for PR preview
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: site
path: ./_site
retention-days: 3