Terraform iac 2 #6
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: Compras SSH | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.PEM_FILE }} | |
REMOTE_USER: ec2-user | |
REMOTE_HOST: ${{ vars.AWS_DEV_HOST }} | |
APP_NAME: app.js | |
on: | |
push: | |
branches: | |
- gonzalo-compras # Cambiar a la rama correspondiente si es diferente | |
jobs: | |
ssh_job: | |
name: SSH Job | |
runs-on: ubuntu-latest # Se puede cambiar a otra versión o SO según sea necesario | |
steps: | |
- name: Ejecutar comando SSH | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ env.REMOTE_HOST }} | |
username: ${{ env.REMOTE_USER }} | |
key: ${{ env.SSH_PRIVATE_KEY }} | |
script: | | |
sudo rm -rf /opt/compras || true |