fix docker image building

This commit is contained in:
zardzul
2026-02-13 10:43:32 +01:00
parent b80687f67d
commit 6abee7cb51
7 changed files with 46 additions and 45 deletions
+29 -13
View File
@@ -2,29 +2,45 @@ name: Build and Publish Docker Image
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
branches:
- main
jobs:
build-and-push:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to git.cashew.network registry
- name: Log in to Docker Registry
uses: docker/login-action@v3
with:
registry: git.cashew.network
username: ${{ secrets.GIT_USERNAME }}
password: ${{ secrets.GIT_PASSWORD }}
- name: Build and push image
registry: ${{ secrets.GIT_HOST }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.GIT_HOST }}/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ secrets.GIT_USERNAME }}/ironveil:${{ github.ref_name }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ secrets.GIT_HOST }}/${{ github.repository }}:buildcache
cache-to: type=registry,ref=${{ secrets.GIT_HOST }}/${{ github.repository }}:buildcache,mode=max