62 lines
1.9 KiB
YAML
62 lines
1.9 KiB
YAML
name: Deploy Container
|
|
description: Build Docker image, deploy container, and register with Pangolin
|
|
|
|
inputs:
|
|
app-name:
|
|
required: true
|
|
description: Application name (used for image/container naming)
|
|
tag:
|
|
required: true
|
|
description: Image/container tag (e.g., "production" or a branch slug)
|
|
port:
|
|
required: true
|
|
description: Host port to expose
|
|
internal-port:
|
|
required: false
|
|
default: "3000"
|
|
description: Port the app listens on inside the container
|
|
environment:
|
|
required: true
|
|
description: Environment name ("production" or "preview")
|
|
subdomain:
|
|
required: true
|
|
description: Subdomain for Pangolin resource
|
|
build-args:
|
|
required: false
|
|
default: ""
|
|
description: Extra docker build args (space-separated KEY=VALUE pairs)
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Build Docker image
|
|
shell: bash
|
|
run: |
|
|
BUILD_ARGS="--build-arg APP_ENV=${{ inputs.environment }}"
|
|
for arg in ${{ inputs.build-args }}; do
|
|
BUILD_ARGS="$BUILD_ARGS --build-arg $arg"
|
|
done
|
|
docker build \
|
|
$BUILD_ARGS \
|
|
-t ${{ inputs.app-name }}:${{ inputs.tag }} \
|
|
-f dockerfile .
|
|
|
|
- name: Deploy container
|
|
shell: bash
|
|
run: |
|
|
bash ${{ github.action_path }}/../scripts/deploy.sh \
|
|
--name "${{ inputs.app-name }}" \
|
|
--tag "${{ inputs.tag }}" \
|
|
--port "${{ inputs.port }}" \
|
|
--internal-port "${{ inputs.internal-port }}" \
|
|
--env "${{ inputs.environment }}"
|
|
|
|
- name: Register Pangolin resource
|
|
shell: bash
|
|
run: |
|
|
bash ${{ github.action_path }}/../scripts/pangolin-upsert.sh \
|
|
--subdomain "${{ inputs.subdomain }}" \
|
|
--port "${{ inputs.port }}" \
|
|
--resource-name "${{ inputs.app-name }}-${{ inputs.tag }}" \
|
|
--target-ip "$PANGOLIN_TARGET_IP"
|