Skip to content

Pin github_pages gem #192

Pin github_pages gem

Pin github_pages gem #192

name: upload-pr-preview
on:
pull_request:
jobs:
upload-pr-preview:
name: upload-pr-preview
runs-on: ubuntu-latest
steps:
- name: 📁 Checkout code
uses: actions/checkout@v2
- name: ♼ Restore npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: 💎 Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: ⬢ Setup Node
uses: actions/setup-node@v1
with:
node-version: '16'
cache: 'npm'
- name: ⚙️ Install dependencies
run: |
./script/bootstrap
- name: 🛠 Build CI-site-preview build
env:
PR_NUMBER: ${{ github.event.number }}
REPO: ${{ github.repository }}
run: |
sed -i "\$ s/\$/ (PR preview build: $(date '+%Y-%m-%d'))/" VERSION
./script/ci-site-preview-build "https://preview.sesh.rs" "/previews/$REPO/$PR_NUMBER"
# Use `build-primer-spec-action` to generate PDFs of each page.
# Docs: https://github.com/seshrs/build-primer-spec-action
- name: 👷‍♀️ Build the rest of the Primer Spec site
uses: seshrs/build-primer-spec-action@main # TODO: Change this to v1 after releasing the new version of build-primer-spec-action
with:
build_jekyll_site: 'false'
configure_github_pages: 'false'
# Upload the site to Primer Spec Preview and comment on the PR.
# The Primer Spec Preview secret is stored as an encrypted repo or
# organization secret named `PRIMER_SPEC_PREVIEW_SECRET`.
# Docs: https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-an-organization
# Docs: https://github.com/seshrs/upload-to-primer-spec-preview
- name: 🚀 Upload to Primer Spec Preview
uses: seshrs/upload-to-primer-spec-preview@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRIMER_SPEC_PREVIEW_SECRET: ${{ secrets.PRIMER_SPEC_PREVIEW_SECRET }}