Skip to content
Merged
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
51 changes: 33 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- dev
pull_request:
branches: ['*']
workflow_dispatch:

name: Latest Release

Expand All @@ -23,6 +24,11 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: '1.24'

# Create a dummy directory to appease the go:embed typechecker
- name: Create dummy dist directory
run: mkdir -p src/web/dist && touch src/web/dist/index.html

- name: golangci-lint
uses: golangci/golangci-lint-action@v8.0.0
with:
Expand Down Expand Up @@ -87,32 +93,35 @@ jobs:
fetch-depth: 0

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

- name: Convert repository name to lowercase
run: |
REPO_LC=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "REPO_LC=$REPO_LC" >> $GITHUB_ENV
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=tag
type=raw,value=latest

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

- name: Build and push
id: build-and-push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/${{ env.REPO_LC }}:latest
ghcr.io/${{ env.REPO_LC }}:${{ github.ref_name }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7
platforms: linux/amd64,linux/arm64,linux/arm/v7
build-args: |
TARGETARCH

Expand All @@ -135,26 +144,32 @@ jobs:
fetch-depth: 0

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

- name: Convert repository name to lowercase
run: echo "REPO_LC=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=dev

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

- name: Build and push dev image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/${{ env.REPO_LC }}:dev
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7
platforms: linux/amd64,linux/arm64,linux/arm/v7
build-args: |
TARGETARCH
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM node:20-alpine AS ui-builder
FROM --platform=$BUILDPLATFORM node:20-alpine AS ui-builder
WORKDIR /app/src/web/frontend
COPY src/web/frontend/package*.json ./
RUN npm ci
COPY src/web/frontend/ ./
RUN npm run build

FROM golang:1.24-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS builder

# Set the working directory
WORKDIR /app
Expand Down
Loading