Skip to content

Add yamllint

Add yamllint #240

Workflow file for this run

# workflow for building and deploying a Jekyll site to GitHub Pages
# based on https://github.com/actions/starter-workflows/blob/main/pages/jekyll.yml
name: Deploy Jekyll site to Pages
on:
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
## Use this job step to debug
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled && always() }}
# with:
# limit-access-to-actor: true
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
# Omit installation of packages in "test" group in Gemfile & prevent
# `bundle exec` from checking for the existence of those packages in
# the (generated) Gemfile.lock
BUNDLE_WITHOUT: test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- run: bundle exec jekyll build --profile --trace --baseurl "${{ steps.pages.outputs.base_path }}" # defaults output to '/_site'
- uses: actions/setup-node@v3
with:
node-version: 18
- run: make jbrowse
- run: mv assets/js/jbrowse _site/assets/js
# create artifact.tar from ./_site directory & upload as artifact named 'github-pages'
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install yamllint
run: python3 -mpip install --no-cache-dir yamllint
- name: Run yamllint
run: yamllint .
check-links:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
with:
name: github-pages
- run: tar -xf artifact.tar && rm artifact.tar
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: install htmlproofer
# need ruby >= 3.1 for html-proofer 5.x
run: gem install html-proofer -v 5.0.8
# Cache HTMLProofer external URL results for 30 days, but using actions/cache/restore
# and actions/cache/save so cache can still be saved when failure is reported
# https://github.com/gjtorikian/html-proofer/#caching-with-continuous-integration
- uses: actions/cache/restore@v3
id: restore-cache-htmlproofer
with:
path: tmp/.htmlproofer
key: ${{ runner.os }}-html-proofer
- name: run htmlproofer
run: |
htmlproofer --allow-missing-href --ignore-missing-alt --ignore-files '/\/uikit\/tests\//' --ignore-status-codes '403,503' --cache '{"timeframe": {"external": "30d"}}'
# https://github.com/actions/cache/blob/main/save/README.md#always-save-cache
- uses: actions/cache/save@v3
id: save-cache-htmlproofer
if: always()
with:
path: tmp/.htmlproofer
key: ${{ runner.os }}-html-proofer
# Deployment job
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [build, yamllint]
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2