Merge branch 'develop' of https://github.com/transfem-org/Sharkey into develop

This commit is contained in:
Mar0xy 2023-09-23 04:53:26 +02:00
commit d3b40ec275
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
3 changed files with 31 additions and 23 deletions

View file

@ -5,10 +5,17 @@ on:
types: [published]
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
name: Push Docker image to GHCR
runs-on: ubuntu-latest
if: github.repository == 'transfem-org/Sharkey'
permissions:
contents: read
packages: write
steps:
- name: Check out the repo
@ -17,12 +24,12 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3.0.0
with:
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: misskey/misskey
images: ${{ env.REGISTRY }}/transfem-org/sharkey
tags: |
type=edge
type=ref,event=pr
@ -30,12 +37,13 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Log in to Docker Hub
- name: Log in to GHCR
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push to Docker Hub
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push to GHCR
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
@ -43,7 +51,7 @@ jobs:
push: true
platforms: ${{ steps.buildx.outputs.platforms }}
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ env.REGISTRY }}/transfem-org/sharkey:stable
labels: stable
cache-from: type=gha
cache-to: type=gha,mode=max

View file

@ -16,7 +16,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
RUN corepack enable
WORKDIR /misskey
WORKDIR /sharkey
COPY --link ["pnpm-lock.yaml", "pnpm-workspace.yaml", "package.json", "./"]
COPY --link ["scripts", "./scripts"]
@ -46,7 +46,7 @@ RUN apt-get update \
RUN corepack enable
WORKDIR /misskey
WORKDIR /sharkey
COPY --link ["pnpm-lock.yaml", "pnpm-workspace.yaml", "package.json", "./"]
COPY --link ["scripts", "./scripts"]
@ -65,25 +65,25 @@ RUN apt-get update \
ffmpeg tini curl libjemalloc-dev libjemalloc2 \
&& ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so \
&& corepack enable \
&& groupadd -g "${GID}" misskey \
&& useradd -l -u "${UID}" -g "${GID}" -m -d /misskey misskey \
&& groupadd -g "${GID}" sharkey \
&& useradd -l -u "${UID}" -g "${GID}" -m -d /sharkey sharkey \
&& find / -type d -path /proc -prune -o -type f -perm /u+s -ignore_readdir_race -exec chmod u-s {} \; \
&& find / -type d -path /proc -prune -o -type f -perm /g+s -ignore_readdir_race -exec chmod g-s {} \; \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists
USER misskey
WORKDIR /misskey
USER sharkey
WORKDIR /sharkey
COPY --chown=misskey:misskey --from=target-builder /misskey/node_modules ./node_modules
COPY --chown=misskey:misskey --from=target-builder /misskey/packages/backend/node_modules ./packages/backend/node_modules
COPY --chown=misskey:misskey --from=native-builder /misskey/built ./built
COPY --chown=misskey:misskey --from=native-builder /misskey/packages/backend/built ./packages/backend/built
COPY --chown=misskey:misskey --from=native-builder /misskey/fluent-emojis /misskey/fluent-emojis
COPY --chown=misskey:misskey . ./
COPY --chown=sharkey:sharkey --from=target-builder /sharkey/node_modules ./node_modules
COPY --chown=sharkey:sharkey --from=target-builder /sharkey/packages/backend/node_modules ./packages/backend/node_modules
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/built ./built
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/packages/backend/built ./packages/backend/built
COPY --chown=sharkey:sharkey --from=native-builder /sharkey/fluent-emojis /sharkey/fluent-emojis
COPY --chown=sharkey:sharkey . ./
ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so
ENV NODE_ENV=production
HEALTHCHECK --interval=5s --retries=20 CMD ["/bin/bash", "/misskey/healthcheck.sh"]
HEALTHCHECK --interval=5s --retries=20 CMD ["/bin/bash", "/sharkey/healthcheck.sh"]
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["pnpm", "run", "migrateandstart"]

View file

@ -3,5 +3,5 @@
# SPDX-FileCopyrightText: syuilo and other misskey contributors
# SPDX-License-Identifier: AGPL-3.0-only
PORT=$(grep '^port:' /misskey/.config/default.yml | awk 'NR==1{print $2; exit}')
PORT=$(grep '^port:' /sharkey/.config/default.yml | awk 'NR==1{print $2; exit}')
curl -s -S -o /dev/null "http://localhost:${PORT}"