Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI | Use new lychee with local file support #156

Merged
merged 15 commits into from
Oct 28, 2021
20 changes: 6 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
steps:
- name: Deploy DietPi-Website locally
id: deploy
run: bash -c "$(curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi-Website${GITHUB_REF#refs/heads}/deploy.bash)" bash .
run: bash -c "$(curl -sSf "https://raw.githubusercontent.com/MichaIng/DietPi-Website${GITHUB_REF#refs/heads}/deploy.bash")" bash .
- name: Setup JRE for Nu Html Checker
# https://github.com/actions/setup-java/releases
uses: actions/setup-java@v2
Expand All @@ -28,31 +28,23 @@ jobs:
uses: actions/setup-python@v2
with:
# https://github.com/actions/python-versions/releases
python-version: '3.10.0-rc.1 - 3.10'
python-version: '3.10'
- name: Install PySpelling
id: pyspelling
if: always() && steps.python.outcome == 'success'
run: |
pip3 install -U pip setuptools wheel
pip3 install -U pyspelling
{ pip3 install -U pip setuptools wheel; pip3 install -U pyspelling; } &
sudo apt-get -q update
sudo apt-get -qq --no-install-recommends install aspell-en
- name: Run PySpelling to check HTML files
if: always() && steps.pyspelling.outcome == 'success'
run: pyspelling -vc .spellcheck.yml
- name: Setup Nginx for lychee
id: nginx
if: always() && steps.deploy.outcome == 'success'
run: |
sudo sed -i "/^[[:blank:]]*root[[:blank:]]/c\root $(pwd);" /etc/nginx/sites-available/default
sudo systemctl restart nginx
- name: Download lychee
id: lychee
if: always() && steps.nginx.outcome == 'success'
if: always() && steps.deploy.outcome == 'success'
run: |
curl -sSfL "$(curl -sSfL https://api.github.com/repos/lycheeverse/lychee/releases/latest | mawk -F\" '/"browser_download_url.*x86_64-unknown-linux-gnu\.tar\.gz"/{print $4;exit}')" -o lychee.tar.gz
curl -sSfL "$(curl -sSf 'https://api.github.com/repos/lycheeverse/lychee/releases/latest' | mawk -F\" '/"browser_download_url.*x86_64-unknown-linux-gnu\.tar\.gz"/{print $4;exit}')" -o lychee.tar.gz
tar xf lychee.tar.gz
rm lychee.tar.gz
- name: Run lychee to check Markdown and HTML files
if: always() && steps.lychee.outcome == 'success'
run: ./lychee -X head -b 'http://127.0.0.1' --github-token '${{ secrets.GITHUB_TOKEN }}' '**/*.md' '**/*.html'
run: ./lychee -Env --require-https --github-token '${{ secrets.GITHUB_TOKEN }}' -X head -b '.' '**/*.md' '**/*.html'