Add .gitea/workflows/*.yaml
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user