a79ed35f33
Co-authored-by: Copilot <copilot@github.com>
36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
name: 'DOCKER BUILD'
|
|
description: '建置 Docker 映像檔'
|
|
author: 'Jeffery'
|
|
inputs:
|
|
REGISTRY_URL:
|
|
description: 'Docker Registry 位址'
|
|
default: 'gitea.jsc.idv.tw'
|
|
REGISTRY_USERNAME:
|
|
description: 'Docker Registry 使用者名稱'
|
|
required: true
|
|
REGISTRY_PASSWORD:
|
|
description: 'Docker Registry 使用者密碼'
|
|
required: true
|
|
IMAGE_OWNER:
|
|
description: 'Docker 映像檔擁有者'
|
|
required: true
|
|
IMAGE_NAME:
|
|
description: 'Docker 映像檔名稱'
|
|
required: true
|
|
RELEASE_VERSION:
|
|
description: '專案版本'
|
|
required: true
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: 取得專案
|
|
uses: actions/checkout@v6
|
|
- name: 登入存取庫
|
|
run: echo ${{ inputs.REGISTRY_PASSWORD }} | docker login ${{ inputs.REGISTRY_URL }} -u ${{ inputs.REGISTRY_USERNAME }} --password-stdin
|
|
shell: bash
|
|
- name: 建置映像檔
|
|
run: docker build -t ${{ inputs.REGISTRY_URL }}/${{ inputs.IMAGE_OWNER }}/${{ inputs.IMAGE_NAME }}:${{ inputs.RELEASE_VERSION }} .
|
|
shell: bash
|
|
- name: 推送映像檔
|
|
run: docker push ${{ inputs.REGISTRY_URL }}/${{ inputs.IMAGE_OWNER }}/${{ inputs.IMAGE_NAME }}:${{ inputs.RELEASE_VERSION }}
|
|
shell: bash |