From ff2a6a452b02f635caa08f1e84da1fa18e548c79 Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Thu, 24 Sep 2026 16:28:23 -0500 Subject: [PATCH] pr and build workflow updates --- .github/workflows/build-docker.yaml | 15 ++++++++++++--- .github/workflows/lint-build.yaml | 28 ++++++++++++++++++++++++++++ eslint.config.mjs | 1 + gulp/build.mjs | 4 ++-- 4 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/lint-build.yaml diff --git a/.github/workflows/build-docker.yaml b/.github/workflows/build-docker.yaml index 753cb70..85d12f5 100644 --- a/.github/workflows/build-docker.yaml +++ b/.github/workflows/build-docker.yaml @@ -2,11 +2,16 @@ name: build-docker on: push: + # main publishes images, dev and dev/* only check that the image builds branches: - - '**' + - main + - dev + - 'dev/**' tags: - 'v*.*.*' - 'v*.*' + # check that pull requests build, without publishing anything + pull_request: jobs: build: @@ -33,11 +38,15 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha + # QEMU is only needed for the arm64 build, which pull requests skip - name: Set up QEMU + if: github.event_name != 'pull_request' uses: docker/setup-qemu-action@v4 - name: Set up Buildx uses: docker/setup-buildx-action@v4 + # pull requests never push, so they don't need to log in (a fork's token is read-only anyway) - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' uses: docker/login-action@v4 with: registry: ghcr.io @@ -49,8 +58,8 @@ jobs: with: context: . pull: true - push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }} - platforms: linux/amd64,linux/arm64/v8 + push: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/') }} + platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64/v8' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha diff --git a/.github/workflows/lint-build.yaml b/.github/workflows/lint-build.yaml new file mode 100644 index 0000000..30390ae --- /dev/null +++ b/.github/workflows/lint-build.yaml @@ -0,0 +1,28 @@ +name: lint-build + +# check that pull requests pass lint and produce a build, nothing is published +on: + pull_request: + +permissions: + contents: read + +jobs: + check: + name: Lint and Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + - name: Set up Node + uses: actions/setup-node@v5 + with: + # matches the Dockerfiles + node-version: 24 + cache: npm + - name: Install + run: npm ci + - name: Lint + run: npm run lint + - name: Build + run: npm run build diff --git a/eslint.config.mjs b/eslint.config.mjs index aec38d8..de3e02c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -71,6 +71,7 @@ const ignores = [ '*.min.*', 'server/scripts/vendor/*', 'dist/**/*', + 'tests', ]; const htmlSpecial = { diff --git a/gulp/build.mjs b/gulp/build.mjs index b40b886..10f42bf 100644 --- a/gulp/build.mjs +++ b/gulp/build.mjs @@ -138,8 +138,8 @@ const otherFiles = [ 'server/robots.txt', 'server/manifest.json', 'server/music/**/*.mp3', - 'apple-touch-icon.png', - 'favicon.ico', + 'server/apple-touch-icon.png', + 'server/favicon.ico', 'server/.well-known/security.txt', ]; const copyOtherFiles = () => src(otherFiles, { base: 'server/', encoding: false })