From 4cb8b370fe675d6620096d654bd66113c9758b1d Mon Sep 17 00:00:00 2001 From: izzy Date: Tue, 23 Jun 2026 08:51:37 +0100 Subject: [PATCH] ci: build to registry Signed-off-by: izzy --- .github/workflows/harbor.yml | 42 ++++++++++++++++++++++++++++++++++++ Dockerfile | 4 ++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/harbor.yml diff --git a/.github/workflows/harbor.yml b/.github/workflows/harbor.yml new file mode 100644 index 00000000..d863582a --- /dev/null +++ b/.github/workflows/harbor.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 58f2aa04..d0514149 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 .