1 Commits

Author SHA1 Message Date
01bce55ade add gitea action
Some checks failed
Build and push docker images / build (push) Failing after 42s
2024-03-13 15:04:27 +08:00

View File

@@ -0,0 +1,46 @@
name: Build and push docker images
on:
push:
tags: ["v*"]
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Gitea Container Registry
uses: docker/login-action@v2
with:
registry: git.yongyuancv.cn
username: ${{ gitea.repository_owner }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Calculate docker image tag
id: set-tag
uses: docker/metadata-action@master
with:
images: |
git.yongyuancv.cn/${{ gitea.repository }}
git.yongyuancv.cn/heimoshuiyu/${{ gitea.event.repository.name }}
flavor: |
latest=false
tags: |
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/main' }}
type=sha,prefix=,format=long
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
- name: Build and push all platforms
uses: docker/build-push-action@v4
with:
push: true
labels: "gitsha1=${{ gitea.sha }}"
tags: "${{ steps.set-tag.outputs.tags }}"
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=git.yongyuancv.cn/${{ gitea.repository }}:buildcache
cache-to: type=registry,ref=git.yongyuancv.cn/${{ gitea.repository }}:buildcache,mode=max