Merge pull request #1 from irfansofyana/add-ci #6
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: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2' | |
bundler-cache: true | |
- name: Build Site | |
run: | | |
bundle install | |
bundle exec jekyll build | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: | | |
npm install -g broken-link-checker | |
npm install -g pa11y-ci | |
sudo apt-get update && sudo apt-get install -y aspell | |
- name: Validate Jekyll Configuration | |
run: ruby -r yaml -e "YAML.load_file('_config.yml')" | |
- name: Start Jekyll Server | |
run: | | |
bundle exec jekyll serve --detach --baseurl '' | |
sleep 5 # Give Jekyll time to start | |
- name: Check for broken links | |
run: | | |
blc http://localhost:4000 -ro --exclude linkedin.com --exclude twitter.com --exclude github.com \ | |
--filter-level 3 \ | |
--user-agent "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" \ | |
--recursive \ | |
--follow |