fix(ci): add docker build template
This commit is contained in:
@@ -2,6 +2,10 @@ name: build-docker-image
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
registry:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
secrets:
|
secrets:
|
||||||
registry-user:
|
registry-user:
|
||||||
required: true
|
required: true
|
||||||
@@ -25,7 +29,7 @@ jobs:
|
|||||||
- name: Login in Private Registry
|
- name: Login in Private Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: git.palkoi.net
|
registry: ${{ inputs.registry }}
|
||||||
username: ${{ secrets.registry-user }}
|
username: ${{ secrets.registry-user }}
|
||||||
password: ${{ secrets.registry-password }}
|
password: ${{ secrets.registry-password }}
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
@@ -33,7 +37,5 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
cache-from: type=registry,ref=git.palkoi.net/${{ env.GITHUB_REPOSITORY }},mode=max
|
|
||||||
cache-to: type=registry,ref=git.palkoi.net/${{ env.GITHUB_REPOSITORY }},mode=max
|
|
||||||
push: true
|
push: true
|
||||||
tags: git.palkoi.net/${{ env.GITHUB_REPOSITORY }}:latest, git.palkoi.net/${{ env.GITHUB_REPOSITORY }}:${{ env.GITHUB_REF_NAME }}-${{ env.GITHUB_RUN_ID }}
|
tags: ${{ inputs.registry }}/${{ env.GITHUB_REPOSITORY }}:latest, ${{ inputs.registry }}/${{ env.GITHUB_REPOSITORY }}:${{ env.GITHUB_REF_NAME }}-${{ env.GITHUB_RUN_ID }}
|
||||||
|
|||||||
Reference in New Issue
Block a user