Skip to content

修改路由函数路径 #13

修改路由函数路径

修改路由函数路径 #13

name: Build and Push Docker Image
on:
push:
# branches:
# - master # Replace with your branch name if different
tags:
- "*"
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
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
docker.io/${{ env.DOCKER_HUB_USERNAME }}/${{ env.DOCKER_HUB_REPO }}
tags: |
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/master' }}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max