build
This commit is contained in:
@@ -5,6 +5,9 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
|
- "master"
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: epusdt
|
IMAGE_NAME: epusdt
|
||||||
@@ -12,21 +15,26 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
push-docker-hub:
|
push-docker-hub:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
TZ: Asia/Shanghai
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Compute Build Metadata
|
- name: Set Up Docker Buildx
|
||||||
id: meta
|
uses: docker/setup-buildx-action@v3
|
||||||
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
|
- 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
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
@@ -38,9 +46,5 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
build-args: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
VERSION=${{ steps.meta.outputs.version }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
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