Add action.yml
This commit is contained in:
36
action.yml
Normal file
36
action.yml
Normal file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user