Comment from ansh on comments-test #2291
This file contains hidden or 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: | |
schedule: | |
- cron: '42 1 * * *' # run at 1:42 AM every day | |
jobs: | |
build-publish: | |
name: Build and Publish | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Main checkout (source) | |
uses: actions/checkout@v2 | |
with: | |
path: main | |
- name: Build Action | |
uses: ./main/.github/actions/build-site | |
- name: Check out destination (HTML) branch | |
uses: actions/checkout@v2 | |
if: env.PUBLISH_BRANCH | |
with: | |
ref: ${{ env.PUBLISH_BRANCH }} | |
path: output | |
- name: Publish site | |
if: env.PUBLISH_BRANCH | |
env: | |
PUB_BRANCH: ${{ env.PUBLISH_BRANCH }} | |
PUB_DEST_DIR: docs | |
PUB_COMMIT_MSG: ${{ github.event.head_commit.message }} | |
run: main/_scripts/publish-github.sh | |
- name: Tar site | |
run: tar czf site.tar.gz _site && du -k site.tar.gz | |
- name: Upload site artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: site | |
path: site.tar.gz | |
screenshots: | |
name: Take Screenshots | |
runs-on: ubuntu-24.04 | |
needs: build-publish | |
if: | | |
github.event_name == 'push' && | |
! startsWith(github.ref, 'refs/heads/staticman_') | |
strategy: | |
fail-fast: false | |
matrix: | |
width: [414, 1200] | |
color-pref: [light, dark] | |
steps: | |
- name: Main checkout (source) | |
uses: actions/checkout@v2 | |
with: | |
path: main | |
- uses: rlespinasse/[email protected] | |
- uses: actions/download-artifact@v4 | |
with: | |
name: site | |
- name: Untar site | |
run: | | |
tar xf site.tar.gz | |
- name: Take and publish screenshots | |
env: | |
SNAPSHOT_REPO: https://github.com/travisdowns/blog-screenshots | |
SNAPSHOT_DEST_PATH: ${{ matrix.color-pref }}-${{ matrix.width }}px | |
SNAPSHOT_BRANCH: ${{ env.GITHUB_REF_SLUG }} | |
SNAPSHOT_USER: ${{ github.actor }} | |
SNAPSHOT_EMAIL: ${{ github.actor }}@users.noreply.github.com | |
SNAPSHOT_REPO_AUTH: ${{ secrets.SNAPSHOT_REPO_AUTH }} | |
SNAPSHOT_EXCLUDES: '**/debug-pages.html,misc/tables/intel-zero-opt/**' | |
SNAPSHOT_WIDTH: ${{ matrix.width }} | |
SNAPSHOT_COLOR_PREF: ${{ matrix.color-pref }} | |
SNAPSHOT_COMMIT_MSG: > | |
[screenshot SNAPSHOT_MOD_TAG mod, SNAPSHOT_NEW_TAG new, | |
SNAPSHOT_COLOR_PREF_TAG-SNAPSHOT_WIDTH_TAGpx] | |
${{ github.actor }}: ${{ github.event.head_commit.message }} | |
run: main/_scripts/snapshot.sh | |
checks: | |
name: ${{ matrix.script.name }} | |
runs-on: ubuntu-24.04 | |
needs: build-publish | |
env: | |
SRC: main | |
SITE: _site | |
strategy: | |
fail-fast: false | |
matrix: | |
script: | |
- path: internal-links.sh | |
name: Internal Links | |
- path: external-links.sh | |
name: External Links | |
- path: validate-html.sh | |
name: Check HTML | |
- path: misc.sh | |
name: Miscellaneous | |
no-html-proofer: true | |
steps: | |
- name: Main checkout (source) | |
uses: actions/checkout@v2 | |
with: | |
path: main | |
- uses: actions/download-artifact@v4 | |
with: | |
name: site | |
- name: Untar site | |
run: | | |
tar xf site.tar.gz | |
- name: Install htmlproofer | |
if: ${{ ! matrix.script.no-html-proofer }} | |
run: | | |
sudo gem install html-proofer -v 3.19.4 --no-document | |
- name: Run ${{ matrix.script.path }} | |
run: main/_scripts/checks/${{ matrix.script.path }} |