Init
This commit is contained in:
85
deploy/action.yml
Normal file
85
deploy/action.yml
Normal file
@@ -0,0 +1,85 @@
|
||||
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: Node environment name ("production" or "preview")
|
||||
subdomain:
|
||||
required: true
|
||||
description: Subdomain for Pangolin resource
|
||||
target-ip:
|
||||
required: true
|
||||
description: Target IP for Pangolin
|
||||
build-args:
|
||||
required: false
|
||||
default: ""
|
||||
description: Extra docker build args (space-separated KEY=VALUE pairs)
|
||||
pangolin-api-url:
|
||||
required: true
|
||||
description: Base URL for the Pangolin API (https://api.pangolin.local)
|
||||
pangolin-api-key:
|
||||
required: true
|
||||
description: Pangolin API key
|
||||
pangolin-org-id:
|
||||
required: true
|
||||
description: Pangolin organization ID
|
||||
pangolin-domain-id:
|
||||
required: true
|
||||
description: Pangolin domain ID
|
||||
pangolin-site-id:
|
||||
required: true
|
||||
description: Pangolin site ID
|
||||
|
||||
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
|
||||
env:
|
||||
PANGOLIN_API_URL: ${{ inputs.pangolin-api-url }}
|
||||
PANGOLIN_API_KEY: ${{ inputs.pangolin-api-key }}
|
||||
PANGOLIN_ORG_ID: ${{ inputs.pangolin-org-id }}
|
||||
PANGOLIN_DOMAIN_ID: ${{ inputs.pangolin-domain-id }}
|
||||
PANGOLIN_SITE_ID: ${{ inputs.pangolin-site-id }}
|
||||
run: |
|
||||
bash ${{ github.action_path }}/../scripts/pangolin-upsert.sh \
|
||||
--subdomain "${{ inputs.subdomain }}" \
|
||||
--port "${{ inputs.port }}" \
|
||||
--resource-name "${{ inputs.app-name }}-${{ inputs.tag }}" \
|
||||
--target-ip "${{ inputs.target-ip }}"
|
||||
Reference in New Issue
Block a user