mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-15 23:20:44 +00:00
49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
name: 🏗️ Ansible | Stop Server
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
environment:
|
|
description: 'Environment to Stop'
|
|
type: environment
|
|
required: true
|
|
default: Test
|
|
|
|
jobs:
|
|
stop-server:
|
|
runs-on: ubuntu-22.04
|
|
environment: ${{inputs.environment}}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: ☕ Setup Java
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'temurin'
|
|
|
|
- name: 🐘 Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v3
|
|
|
|
- name: 🐘 Gradle Build
|
|
run: CI=true ./gradlew :ansible:build
|
|
|
|
- name: Inject secrets
|
|
run: 'echo "$SECRETS_YML" > variables/secrets.yml'
|
|
shell: bash
|
|
working-directory: ./ansible
|
|
env:
|
|
SECRETS_YML: ${{secrets.SECRETS_YML}}
|
|
SUDO_PASSWORD: ${{secrets.SUDO_PASSWORD}}
|
|
|
|
- name: Stop Server
|
|
uses: dawidd6/action-ansible-playbook@v2
|
|
with:
|
|
playbook: ansible/playbooks/stop-server.yml
|
|
requirements: ansible/requirements.yml
|
|
key: ${{secrets.SSH_PRIVATE_KEY}}
|
|
known_hosts: ${{secrets.SSH_KNOWN_HOSTS}}
|
|
options: |
|
|
--inventory "./ansible/inventories/civmc-${{inputs.environment}}.yml"
|
|
-e "ansible_become_password=${{secrets.SUDO_PASSWORD}}"
|