Skip to content

Commit

Permalink
重修github image
Browse files Browse the repository at this point in the history
  • Loading branch information
LoveU3th committed May 23, 2024
1 parent 440c0fa commit 416f916
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/Build and Push Docker Image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,28 @@ on:
branches:
- master # Replace with your branch name if different

env:
DOCKER_HUB_USERNAME: cursor1st
DOCKER_HUB_REPO: override # Replace with your repo name


jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

# - name: Save dev version info
# run: |
# HASH=$(git rev-parse --short=7 HEAD)
# echo "dev-$HASH" > VERSION

# - name: Save Tag version info
# if: startsWith(github.ref, 'refs/tags/')
# run: |
# git describe --tags > VERSION

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

Expand All @@ -26,12 +41,13 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: cursor1st/override
images: |
docker.io/${{ env.DOCKER_HUB_USERNAME }}/${{ env.DOCKER_HUB_REPO }}
tags: |
type=ref,event=tag
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/master' }}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
type=semver,pattern={{version}}
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand Down

0 comments on commit 416f916

Please sign in to comment.