Skip to content

Commit

Permalink
github action
Browse files Browse the repository at this point in the history
  • Loading branch information
star7th committed Mar 26, 2023
1 parent d4d55e9 commit 242c165
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build and push Docker image
on:
release:
types: [published]

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: star7th/showdoc:${{ github.event.release.tag_name }}
7 changes: 1 addition & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches:
- "master"
tags:
- "v*.*.*" # 匹配以 v 开头,后跟三个数字的标签

jobs:
docker:
Expand All @@ -25,7 +23,4 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
tags:
- star7th/showdoc:latest
- star7th/showdoc:${{ github.ref }}
- star7th/showdoc:${{ github.ref | replace('refs/tags/','') }}
tags: star7th/showdoc:latest

0 comments on commit 242c165

Please sign in to comment.