mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-11-28 10:18:05 -08:00
pr and build workflow updates
This commit is contained in:
4 files changed
+43
-5
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -71,6 +71,7 @@ const ignores = [
|
||||
'*.min.*',
|
||||
'server/scripts/vendor/*',
|
||||
'dist/**/*',
|
||||
'tests',
|
||||
];
|
||||
|
||||
const htmlSpecial = {
|
||||
|
||||
+2
-2
@@ -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 })
|
||||
|
||||
Reference in new issue
Block a user