mirror of
https://github.com/matifali/update-coder-template.git
synced 2024-11-13 02:27:25 +08:00
61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
name: Update Coder Template
|
|
description: An action to deploy changes to your coder template automatically
|
|
author: "Muhammad Atif Ali <matifali@live.com>"
|
|
|
|
branding:
|
|
icon: arrow-up-circle
|
|
color: green
|
|
|
|
inputs:
|
|
id:
|
|
description: "Template identifier (e.g. my-template)"
|
|
required: true
|
|
url:
|
|
description: "Coder access URL (e.g. https://coder.example.com)"
|
|
required: true
|
|
coder_session_token:
|
|
description: "Coder session token"
|
|
required: true
|
|
dir:
|
|
description: "Template directory name (path to the directory containing the main.tf file default: TEMPLATE_NAME)"
|
|
required: false
|
|
name:
|
|
description: "Template version name (e.g. v1.0.0, commit hash, etc.), should be unique, default: a random string"
|
|
required: false
|
|
activate:
|
|
description: "Marks the current template version as active"
|
|
required: false
|
|
default: "true"
|
|
message:
|
|
description: "update message"
|
|
required: false
|
|
default: "Updated via update-coder-template action"
|
|
create:
|
|
description: "Creates a new template if it does not exist"
|
|
required: false
|
|
default: "true"
|
|
dry_run:
|
|
description: "Dry run"
|
|
required: false
|
|
default: "true" # make it false after testing TODO
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- run: curl -fsSL $CODER_URL/bin/coder-linux-amd64 -o /usr/local/bin/coder && chmod +x /usr/local/bin/coder
|
|
shell: bash
|
|
env:
|
|
CODER_URL: ${{ inputs.url }}
|
|
|
|
- run: ${{ github.action_path }}/push_template.sh
|
|
shell: bash
|
|
env:
|
|
CODER_SESSION_TOKEN: ${{ inputs.coder_session_token }}
|
|
CODER_URL: ${{ inputs.url }}
|
|
CODER_TEMPLATE_ID: ${{ inputs.id }}
|
|
CODER_TEMPLATE_DIR: ${{ inputs.dir }}
|
|
CODER_TEMPLATE_VERSION_NAME: ${{ inputs.name }}
|
|
CODER_TEMPLATE_ACTIVATE: ${{ inputs.activate }}
|
|
CODER_TEMPLATE_MESSAGE: ${{ inputs.message }}
|
|
CODER_TEMPLATE_CREATE: ${{ inputs.create }}
|
|
CODER_TEMPLATE_DRY_RUN: ${{ inputs.dry_run }}
|