From d635a0ceed26ba96839a0c494675a3c5630e994d Mon Sep 17 00:00:00 2001 From: hangpersonal Date: Sat, 18 Oct 2025 12:24:19 -0700 Subject: [PATCH] Add .gitea/workflows/*.yaml --- .gitea/workflows/010_ci_docker_image.yaml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/010_ci_docker_image.yaml b/.gitea/workflows/010_ci_docker_image.yaml index 15a9cff..c7a76e5 100644 --- a/.gitea/workflows/010_ci_docker_image.yaml +++ b/.gitea/workflows/010_ci_docker_image.yaml @@ -3,9 +3,19 @@ name: Example CI on: workflow_dispatch: inputs: + image-name: + description: "Name for image" + default: "gitea.cuihang1201.synology.me/hangpersonal/ci-test" + type: string + required: true image-tag: description: "Tag for image" - default: "latest" # Define Docker image tag + default: "latest" + type: string + required: true + container-name: + description: "Name for container" + default: "ci-test" type: string required: true @@ -56,7 +66,7 @@ jobs: uses: docker/build-push-action@v5 # Build Docker image via Dockerfile with: context: backend # Directory of Dockerfile - tags: ${{ vars.IMAGE }}:${{ inputs.image-tag }} + tags: ${{ inputs.image-name }}:${{ inputs.image-tag }} outputs: type=docker,dest=/tmp/image.tar - name: Upload artifact @@ -78,9 +88,9 @@ jobs: run: | docker load --input /tmp/image.tar docker image ls -a - docker run --rm -p 8143:80 -d ${{ vars.IMAGE }}:${{ inputs.image-tag }} + docker run --rm -p 8143:80 --name ${{ inputs.container-name }} -d ${{ inputs.image-name }}:${{ inputs.image-tag }} sleep 5 - curl --fail 'http://localhost:8143/' + curl --fail 'http://${{ vars.LOCALHOST }}:8143/' publish-image: runs-on: ubuntu-22.04