Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build Self-Host Images

on:
push:
branches: [main]
tags: ['v*']
paths:
- 'Dockerfile'
- 'src/ws/**'
- 'package.json'
- 'pnpm-lock.yaml'
- '.github/workflows/build-images.yml'
workflow_dispatch: {}

permissions:
contents: read
packages: write

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: web
context: .
dockerfile: Dockerfile
- name: ws
context: ./src/ws
dockerfile: ./src/ws/Dockerfile
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/sarge-${{ matrix.name }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=tag
type=sha,format=short

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.name }}
cache-to: type=gha,mode=max,scope=${{ matrix.name }}
2 changes: 1 addition & 1 deletion src/ws/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ FROM node:22-slim
WORKDIR /src/ws
RUN corepack enable pnpm
COPY package.json index.js pnpm-lock.yaml* ./
RUN pnpm install
RUN pnpm install --allow-build=bufferutil,utf-8-validate

CMD ["node", "index.js"]
Loading