From 9a19067483c37d730c701226fda6b3f93348350c Mon Sep 17 00:00:00 2001 From: nythepegasus Date: Tue, 22 Oct 2024 16:31:38 -0400 Subject: [PATCH] Fix linting for both publishing as well as PRs --- .github/workflows/lint-json.yml | 3 --- .github/workflows/static.yml | 20 +++++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint-json.yml b/.github/workflows/lint-json.yml index fc62967..7284ac1 100644 --- a/.github/workflows/lint-json.yml +++ b/.github/workflows/lint-json.yml @@ -1,9 +1,6 @@ name: Lint JSON on: - push: - branches: - - main pull_request: branches: - main diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index f2c9e97..17bf1ec 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -31,12 +31,30 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Update APT cache + run: sudo apt-get update + - name: Install jq + run: sudo apt-get install -y jq + - name: Lint servers.json + run: | + if ! jq empty servers.json; then + echo "Invalid JSON file detected in servers.json" + exit 1 + else + echo "servers.json is valid" + fi + - name: Cache APT packages + uses: actions/cache@v4 + with: + path: /var/cache/apt/archives + key: ${{ runner.os }}-apt-cache + restore-keys: | + ${{ runner.os }}-apt-cache - name: Setup Pages uses: actions/configure-pages@v5 - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - # Upload entire repository path: '.' - name: Deploy to GitHub Pages id: deployment