From bd689e4d7817a41d30377b3b9225b2cbe66218c3 Mon Sep 17 00:00:00 2001 From: tienngo Date: Fri, 6 Feb 2026 10:01:01 +0000 Subject: [PATCH] Add action.yml --- action.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..c3a5993 --- /dev/null +++ b/action.yml @@ -0,0 +1,36 @@ +name: Deploy Template + +on: + workflow_call: + inputs: + runner: + required: true + type: string + image: + required: true + type: string + +jobs: + deploy: + runs-on: ${{ inputs.runner }} + + steps: + - name: Show target server + run: echo "Deploying on ${{ inputs.runner }}" + + # Force compose to use the exact image tag we built/pushed, regardless of + # what the server's compose file has hard-coded. + - name: Compose Up (Linux) + if: runner.os != 'Windows' + env: + DOCKER_IMAGE: ${{ inputs.image }} + run: | + docker compose up -d --pull always --remove-orphans + + - name: Compose Up (Windows) + if: runner.os == 'Windows' + env: + DOCKER_IMAGE: ${{ inputs.image }} + run: | + docker compose up -d --pull always --remove-orphans +