Skip to content

Commit

Permalink
🚀 Add Docker Hub deployment and update GitHub Actions workflow
Browse files Browse the repository at this point in the history
- Add Docker Hub registry login in GitHub Actions
- Update README with Docker Hub pull instructions
- Modify version to 1.0.14
- Expand deployment documentation
  • Loading branch information
yeongpin committed Feb 20, 2025
1 parent 8b854d1 commit b528373
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:

env:
REGISTRY: ghcr.io
DOCKERHUB_REGISTRY: docker.io
IMAGE_NAME: ${{ github.repository }}

jobs:
Expand Down Expand Up @@ -44,18 +45,26 @@ jobs:
name: lanchat-web
path: dist/

- name: Log in to the Container registry
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
${{ secrets.DOCKERHUB_USERNAME }}/lanlocalchat
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ server {
}
```
## 🔄 使用Docker 部署
```
```bash
# 從 GitHub Container Registry 拉取
docker run -p 13050:13050 ghcr.io/yeongpin/lanlocalchat:main

# 或從 Docker Hub 拉取
docker run -p 13050:13050 username/lanlocalchat:main
```

## 🛠 技術棧
Expand Down Expand Up @@ -163,6 +167,12 @@ docker run -p 13050:13050 ghcr.io/yeongpin/lanlocalchat:main

## 📝 更新日誌

### v1.0.14

- 🔄 新增Docker Hub 部署
- 🔄 新增GitHub Actions 部署
- 修復已知問題

### v1.0.13

- 🔄 新增Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lan-chat",
"version": "1.2.0",
"version": "1.0.14",
"description": "LAN Chat Application",
"main": "server/server.js",
"scripts": {
Expand Down

0 comments on commit b528373

Please sign in to comment.