Skip to content

Commit

Permalink
Create build-docker-image-tag.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuchunshu committed Feb 13, 2023
1 parent e73e027 commit 3cae588
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-docker-image-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 发布带标签的docker镜像

on:
push:
tags:
- "v*.*.*"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: 'Get next minor version'
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previoustag.outputs.tag }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

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


- name: Build and push
uses: docker/build-push-action@v4
with:
platforms: linux/arm,linux/arm64,linux/amd64,darwin,windows/amd64
push: true
tags: |
zhuchunshu/sforum:${{ steps.previoustag.outputs.tag }}


0 comments on commit 3cae588

Please sign in to comment.