37 lines
866 B
YAML
37 lines
866 B
YAML
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
|
|
|