53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
name: Create New Stack or Template
|
|
run-name: Create ${{ inputs.folder_type }}/${{ inputs.app_name }} by @${{ gitea.actor }}
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
app_name:
|
|
description: 'Name of the app (e.g., plex, nginx)'
|
|
required: true
|
|
type: string
|
|
folder_type:
|
|
description: 'Is this a template or a stack?'
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- templates
|
|
- stacks
|
|
default: 'stacks'
|
|
|
|
jobs:
|
|
create-files:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Create Directory and Files
|
|
run: |
|
|
TARGET_DIR="${{ inputs.folder_type }}/${{ inputs.app_name }}"
|
|
mkdir -p "$TARGET_DIR"
|
|
|
|
# Create empty docker-compose
|
|
touch "$TARGET_DIR/docker-compose.yml"
|
|
|
|
# Create README with basic template
|
|
cat <<EOF > "$TARGET_DIR/README.md"
|
|
# ${{ inputs.app_name }} (${{ inputs.folder_type }})
|
|
|
|
### Description
|
|
Description for ${{ inputs.app_name }} goes here.
|
|
|
|
### Configuration
|
|
- Path: $TARGET_DIR/docker-compose.yml
|
|
- Status: Draft
|
|
EOF
|
|
|
|
- name: Commit and Push
|
|
run: |
|
|
git config --global user.name "Gitea Action"
|
|
git config --global user.email "actions@gitea.io"
|
|
git add .
|
|
git commit -m "feat: initialized ${{ inputs.folder_type }}/${{ inputs.app_name }}."
|
|
git push |