mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 18:26:16 +00:00
build
This commit is contained in:
@@ -5,6 +5,9 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
- "master"
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
env:
|
||||
IMAGE_NAME: epusdt
|
||||
@@ -12,21 +15,26 @@ env:
|
||||
jobs:
|
||||
push-docker-hub:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TZ: Asia/Shanghai
|
||||
|
||||
steps:
|
||||
- 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: Set Up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login
|
||||
- name: Docker Metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=raw,value=alpine
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=ref,event=branch,suffix=-alpine
|
||||
type=ref,event=tag,suffix=-alpine
|
||||
type=sha,prefix=sha-,suffix=-alpine
|
||||
|
||||
- name: Login To Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
@@ -38,9 +46,5 @@ jobs:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
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
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
Reference in New Issue
Block a user