Manual Deployment #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Manual Deployment | |
on: | |
workflow_dispatch: | |
inputs: | |
type: | |
description: "Type of deployment" | |
required: true | |
type: choice | |
options: | |
- "ansible" | |
- "cdktf" | |
action: | |
description: "Action to perform" | |
required: true | |
type: choice | |
options: | |
- "deploy" | |
- "diff" | |
- "destroy" | |
default: "deploy" | |
host: | |
description: "Host to run Ansible against" | |
required: true | |
type: choice | |
options: | |
- "allaboutsecurity" | |
- "authentik" | |
- "gaming" | |
- "gaps" | |
- "healthchecks" | |
- "monitoring" | |
- "nextcloud" | |
- "nodered" | |
- "pihole" | |
- "securemylife" | |
- "vault" | |
- "youtubedl" | |
dry_run: | |
description: "Dry run" | |
required: true | |
type: boolean | |
default: true | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
type: ${{ steps.setup.outputs.type }} | |
action: ${{ steps.setup.outputs.action }} | |
host: ${{ steps.setup.outputs.host }} | |
dry_run: ${{ steps.setup.outputs.dry_run }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Setup | |
id: setup | |
run: | | |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
echo "type=${{ github.event.inputs.type }}" >> $GITHUB_OUTPUT | |
echo "action=${{ github.event.inputs.action }}" >> $GITHUB_OUTPUT | |
echo "host=${{ github.event.inputs.host }}" >> $GITHUB_OUTPUT | |
else | |
echo "Unknown event name: ${{ github.event_name }}" | |
exit 1 | |
fi | |
ansible: | |
name: "Ansible CICD" | |
needs: setup | |
if: ${{ needs.setup.outputs.type == 'ansible' }} | |
uses: ./.github/workflows/ansible-cicd.yml | |
with: | |
host: ${{ needs.setup.outputs.host }} | |
dry_run: ${{ github.event.inputs.dry_run }} | |
cdktf: | |
name: "CDKTF CICD" | |
needs: setup | |
if: ${{ needs.setup.outputs.type == 'cdktf' }} | |
uses: ./.github/workflows/cdktf-cicd.yml | |
with: | |
action: ${{ needs.setup.outputs.action }} |