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
31 changes: 6 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,15 @@ jobs:
https://raw.githack.com/jaywcjlove/linux-command/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html


## Docker
## Docker (GHCR)

[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command) [![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command) [![Docker Pulls](https://img.shields.io/docker/pulls/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command)

轻松通过 `docker` 部署 `linux-command` 网站。
轻松通过 `docker` 部署 `linux-command` 网站:

```bash
docker pull wcjiang/linux-command
```

```bash
docker run --name linux-command --rm -d -p 9665:3000 wcjiang/linux-command:latest
docker pull ghcr.io/${{ github.repository_owner }}/linux-command:latest
docker run --name linux-command --rm -d -p 9665:3000 ghcr.io/${{ github.repository_owner }}/linux-command:latest
# Or
docker run --name linux-command -itd -p 9665:3000 wcjiang/linux-command:latest
docker run --name linux-command -itd -p 9665:3000 ghcr.io/${{ github.repository_owner }}/linux-command:latest
```

在浏览器中访问以下 URL
Expand Down Expand Up @@ -137,7 +132,7 @@ jobs:
continue-on-error: true
name: 📦 linux-command publish to NPM

# Docker 构建并推送(未配置 DOCKER_USER/DOCKER_PASSWORD 时跳过,不报错
# Docker 构建并推送(仅推送到 GHCR
- name: Set up Docker Buildx
if: env.IS_RELEASE == 'true'
uses: docker/setup-buildx-action@v3
Expand All @@ -149,28 +144,14 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Docker Hub (optional)
if: env.IS_RELEASE == 'true' && secrets.DOCKER_USER != '' && secrets.DOCKER_PASSWORD != ''
uses: docker/login-action@v3
continue-on-error: true
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Prepare image tags
if: env.IS_RELEASE == 'true'
id: image_tags
run: |
tags="ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}:latest"
if [ -n "${{ secrets.DOCKER_USER }}" ]; then
tags="$tags,${{ secrets.DOCKER_USER }}/${IMAGE_NAME}:latest"
fi
if [ "${{ steps.create_tag.outputs.successful }}" = "true" ] && [ -n "${{ steps.changelog.outputs.version }}" ]; then
version="${{ steps.changelog.outputs.version }}"
tags="$tags,ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}:${version}"
if [ -n "${{ secrets.DOCKER_USER }}" ]; then
tags="$tags,${{ secrets.DOCKER_USER }}/${IMAGE_NAME}:${version}"
fi
fi
echo "tags=$tags" >> "$GITHUB_OUTPUT"

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

[![GitHub](https://img.shields.io/badge/GitHub-jaywcjlove%2Flinux--command-333?logo=github)](https://github.com/jaywcjlove/linux-command)
[![NPM](https://img.shields.io/npm/dm/linux-command.svg?style=flat)](https://www.npmjs.com/package/linux-command)
[![Docker](https://img.shields.io/docker/image-size/wcjiang/linux-command?logo=docker)](https://hub.docker.com/r/wcjiang/linux-command)
[![Container](https://img.shields.io/badge/ghcr.io-jaywcjlove/linux--command-blue?logo=docker)](https://ghcr.io/jaywcjlove/linux-command)

当前仓库搜集了 600 多个 Linux 命令,生成 Web 站点便于查阅,内容包含 Linux 命令手册、详解与学习,来自网络与网友补充,适合作为速查手册。版权归原作者,Fork 仅作学习与备份。

Expand All @@ -29,18 +29,18 @@ Chrome 插件、Alfred、Dash、Krunner、Android 等见 [原仓库 README](http

## Docker 部署

[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/wcjiang/linux-command?logo=docker)](https://hub.docker.com/r/wcjiang/linux-command) [![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/wcjiang/linux-command?logo=docker)](https://hub.docker.com/r/wcjiang/linux-command) [![Docker Pulls](https://img.shields.io/docker/pulls/wcjiang/linux-command?logo=docker)](https://hub.docker.com/r/wcjiang/linux-command)
[![Container Image](https://img.shields.io/badge/ghcr.io-jaywcjlove/linux--command-blue?logo=docker)](https://ghcr.io/jaywcjlove/linux-command)

通过 Docker 部署 linux-command 网站:
通过 Docker 部署 linux-command 网站(GHCR)

```bash
docker pull wcjiang/linux-command
docker pull ghcr.io/jaywcjlove/linux-command:latest
```

```bash
docker run --name linux-command --rm -d -p 9665:3000 wcjiang/linux-command:latest
docker run --name linux-command --rm -d -p 9665:3000 ghcr.io/jaywcjlove/linux-command:latest
# Or
docker run --name linux-command -itd -p 9665:3000 wcjiang/linux-command:latest
docker run --name linux-command -itd -p 9665:3000 ghcr.io/jaywcjlove/linux-command:latest
```

在浏览器中访问:
Expand Down