-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4570e49
commit 934796c
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters