mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 10:16:15 +00:00
build(release): add tag-based release automation and version metadata
This commit is contained in:
@@ -1,28 +1,46 @@
|
||||
name: docker-alpine-epusdt
|
||||
on:
|
||||
workflow_dispatch: #github页面手动触发
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
env:
|
||||
IMAGE_NAME: epusdt #这是您的镜像名
|
||||
|
||||
jobs:
|
||||
push-docker-hub:
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
env:
|
||||
IMAGE_NAME: epusdt
|
||||
|
||||
jobs:
|
||||
push-docker-hub:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TZ: Asia/Shanghai
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Compute Build Metadata
|
||||
id: meta
|
||||
shell: bash
|
||||
run: |
|
||||
echo "version=main-${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
|
||||
echo "commit=${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
|
||||
echo "date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Login
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build && Push
|
||||
uses: docker/build-push-action@v4
|
||||
|
||||
- name: Build And Push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
build-args: |
|
||||
VERSION=${{ steps.meta.outputs.version }}
|
||||
COMMIT=${{ steps.meta.outputs.commit }}
|
||||
DATE=${{ steps.meta.outputs.date }}
|
||||
tags: |
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:alpine
|
||||
|
||||
Reference in New Issue
Block a user