Skip to content

Commit

Permalink
处理tag和meta
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaojianli committed Jan 26, 2025
1 parent a4b29b5 commit d08cf9c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 14 deletions.
44 changes: 30 additions & 14 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Docker Image CI
on:
push:
branches: [ "miao" ]
tags:
- 'v*'
pull_request:
branches: [ "miao" ]

Expand All @@ -15,13 +17,24 @@ jobs:
with:
daemon-config: |
{
"debug": true,
"features": {
"containerd-snapshotter": true
}
}
- uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
gaojianli2333/trunker
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'miao') }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -34,22 +47,24 @@ jobs:
with:
platforms: linux/amd64
push: true
tags: gaojianli2333/trunker:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-arm:
runs-on: ubuntu-24.04-arm
steps:
- name: Set up Docker
uses: docker/setup-docker-action@v4
with:
daemon-config: |
{
"debug": true,
"features": {
"containerd-snapshotter": true
}
}
- uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
gaojianli2333/trunker
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'miao') }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -62,4 +77,5 @@ jobs:
with:
platforms: linux/arm64
push: true
tags: gaojianli2333/trunker:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM golang:alpine AS build
WORKDIR /build
COPY . .
RUN apk add --no-cache git
RUN sh build.sh

FROM alpine
Expand Down

0 comments on commit d08cf9c

Please sign in to comment.