Skip to content

Update artifact upload to work with version 4 of upload-artifact #3749

Update artifact upload to work with version 4 of upload-artifact

Update artifact upload to work with version 4 of upload-artifact #3749

Workflow file for this run

---
on:
pull_request:
push:
branches-ignore:
- gh-pages
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: ruby/setup-ruby@af848b40be8bb463a751551a1180d74782ba8a72
with:
bundler-cache: true
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
with:
node-version: '16'
- name: Cache node modules
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: npm-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-${{ runner.os }}-build-${{ env.cache-name }}-
npm-${{ runner.os }}-build-
npm-
- name: Install NPM dependencies
run: npm install
- name: Test
run: bundle exec rspec
- name: Lint
run: bundle exec rubocop --parallel
- name: Validate schema
run: bundle exec rake schema
- name: Build
run: bundle exec rake build
- name: Upload built site
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392
with:
name: site-${{ matrix.runs-on }}
path: build
retention-days: 1
htmlproofer:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: ruby/setup-ruby@af848b40be8bb463a751551a1180d74782ba8a72
with:
bundler-cache: true
- name: Download built site
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
path: build
pattern: site-*
+ merge-multiple: true
- name: Test built site

Check failure on line 77 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 77
run: bundle exec rake htmlproofer
publish:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: build
permissions:
contents: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: ruby/setup-ruby@af848b40be8bb463a751551a1180d74782ba8a72
with:
bundler-cache: true
- name: Download built site
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
path: build
pattern: site-*
+ merge-multiple: true
# Checkout stripped-down gh-pages branch to a subdirectory, for publishing
- name: Checkout gh-pages branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: gh-pages
path: tmp/publish
- name: Publish
run: |
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions"
bundle exec rake publish CLONED_GH_PAGES_DIR="tmp/publish"