27 lines
689 B
YAML
27 lines
689 B
YAML
name: Deploy Automático
|
|
on:
|
|
push:
|
|
branches: [ main ] # Dispara o deploy sempre que houver push na main
|
|
workflow_dispatch:
|
|
inputs:
|
|
commit:
|
|
description: 'Commit hash para Rollback (vazio = HEAD da main)'
|
|
default: ''
|
|
|
|
|
|
jobs:
|
|
job_deploy:
|
|
runs-on: ubuntu-latest # Deve coincidir com a label no seu config.yaml
|
|
steps:
|
|
- name: Checkout do código
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Checkout commit específico (se fornecido)
|
|
run: |
|
|
COMMIT="${{ github.event.inputs.commit }}"
|
|
if [ -n "$COMMIT" ]; then
|
|
git checkout "$COMMIT"
|
|
fi
|
|
|