From ff42eb021f4539701e5239f822d17f7222c73bfb Mon Sep 17 00:00:00 2001 From: nanmu42 Date: Fri, 31 May 2024 22:58:07 +0800 Subject: [PATCH] chore: update Dockerfile and GitHub actions --- .github/workflows/build.yml | 12 ++++++------ .github/workflows/docker.yml | 2 +- Dockerfile | 7 ++----- Makefile | 10 ++++++++-- README.md | 6 +----- frontend/.npmrc | 1 + 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12a19d6..ec6095d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,20 +7,20 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16.15.1 + node-version: 20.13.1 - name: Build Frontend run: make frontend - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: 1.x + go-version: stable - name: Get dependencies run: go get ./... @@ -29,6 +29,6 @@ jobs: run: make rly - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: version: latest diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1b1abf0..08847ff 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build, tag, and push env: DOCKER_HUB_REPO: nanmu42/orly diff --git a/Dockerfile b/Dockerfile index 5fe643f..0ebf821 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,13 +4,10 @@ RUN wget -qO /bin/pnpm "https://github.com/pnpm/pnpm/releases/latest/download/pn WORKDIR /app COPY . . -RUN mkdir -p assets && \ - cd assets && \ - wget -nc https://github.com/nanmu42/orly/releases/download/1.5.0-beta/cover-images.tar.xz && \ - wget -nc https://github.com/nanmu42/orly/releases/download/1.1.0-beta/fonts.tar.xz +RUN make assets RUN make all -FROM alpine:3.17 +FROM alpine3.20 # Maintainer Info LABEL maintainer="nanmu42" # Dependencies diff --git a/Makefile b/Makefile index 51d4e8a..5e466a3 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,12 @@ dir: mkdir -p bin/fonts && \ mkdir -p bin/cover-images +assets: + mkdir -p assets && \ + cd assets && \ + wget -nc https://github.com/nanmu42/orly/releases/download/1.5.0-beta/cover-images.tar.xz && \ + wget -nc https://github.com/nanmu42/orly/releases/download/1.1.0-beta/fonts.tar.xz + clean: rm -rf bin @@ -26,11 +32,11 @@ frontend: dir rly: rly.bin -fonts: dir +fonts: dir assets cd assets && \ tar -xf fonts.tar.xz --skip-old-files -C $(PWD)/bin/fonts -covers: dir +covers: dir assets cd assets && \ tar -xf cover-images.tar.xz --skip-old-files -C $(PWD)/bin/cover-images diff --git a/README.md b/README.md index fc51d49..a6da711 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,7 @@ Save as `rly.toml`, mount it into `/app/config`, and run docker image with param O'RLY can be built in following commands: ```bash -mkdir -p assets -cd assets -wget -nc https://github.com/nanmu42/orly/releases/download/1.5.0-beta/cover-images.tar.xz -wget -nc https://github.com/nanmu42/orly/releases/download/1.1.0-beta/fonts.tar.xz -cd .. +make assets make all ``` diff --git a/frontend/.npmrc b/frontend/.npmrc index 4a8e962..3e36b03 100644 --- a/frontend/.npmrc +++ b/frontend/.npmrc @@ -1 +1,2 @@ node-options=--openssl-legacy-provider +node-linker=hoisted \ No newline at end of file