ci: build to registry

Signed-off-by: izzy <me@insrt.uk>
This commit is contained in:
izzy
2026-06-23 08:51:37 +01:00
parent 41f47a1a3f
commit 4cb8b370fe
2 changed files with 46 additions and 0 deletions

42
.github/workflows/harbor.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Publish to Harbor
on:
push:
branches:
- "master"
workflow_dispatch:
jobs:
legacy-frontend:
name: Build and push to Harbor
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Harbor
uses: docker/login-action@v3
with:
registry: registry.stoatinternal.com
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
registry.stoatinternal.com/stoat/legacy-frontend:${{ github.sha }}
registry.stoatinternal.com/stoat/legacy-frontend:latest
build-args: |
REVOLT_PUBLIC_URL=https://api.stoat.chat/
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -13,6 +13,10 @@ RUN yarn workspaces focus --production --all
FROM node:24-alpine
WORKDIR /usr/src/app
ARG REVOLT_PUBLIC_URL=https://api.stoat.chat/
ENV REVOLT_PUBLIC_URL=$REVOLT_PUBLIC_URL
COPY docker/package.json docker/yarn.lock .
RUN yarn install --frozen-lockfile
COPY --from=builder --exclude=package.json --exclude=yarn.lock --exclude=.yarn* --exclude=.git --exclude=external --exclude=node_modules /usr/src/app .