Skip to content

Commit

Permalink
ci: Docker Image CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkasany committed Dec 19, 2023
1 parent 4570e49 commit 934796c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Docker Image CI/CD
on:
push:
tags:
- 'v*'
jobs:
# 构建并上传 Docker镜像
build:
runs-on: ubuntu-latest # 依赖的环境
steps:
- uses: actions/checkout@v2
- name: Set Docker Image Tag
run: |
DOCKER_TAG=$(echo "${{ github.ref }}" | sed -n 's/refs\/tags\/v//p')
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV
- name: Build Image
run: |
docker build -f Dockerfile -t thinkerwing/docs:${DOCKER_TAG} .
- name: Login to Registry
run: docker login --username=${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }}
- name: Push Image
run: |
docker push thinkerwing/docs:${DOCKER_TAG}
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ CMD ["docsify", "serve", "."]

# docker ps -a

# ddocker build -f Dockerfile -t docsify/docs .
# docker build -f Dockerfile -t docsify/docs .

# docker run -itp 3000:3000 --name=docsify -v $(pwd):/docs docsify/docs
# docker run -itp 3000:3000 --name=docsify -v $(pwd):/docs docsify/docs

# https://cloud.tencent.com/developer/article/1970757

0 comments on commit 934796c

Please sign in to comment.