Merge pull request #448 from DrDroidLab/@hotfix/task-enhancements #41
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: Deploy Coruscant | |
on: | |
push: | |
branches: | |
- main # Change this to the branch you want to trigger on | |
jobs: | |
ssh-ec2: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Create PEM file from secret | |
run: echo "${{ secrets.SID_EC2_PEM_FILE }}" > ec2_key.pem | |
- name: Set permissions for the PEM file | |
run: chmod 600 ec2_key.pem | |
- name: SSH and run script | |
env: | |
EC2_IP_ADDRESS: ${{ secrets.CORUSCANT_EC2_IP_ADDRESS }} | |
run: | | |
ssh -o StrictHostKeyChecking=no -i ec2_key.pem ec2-user@${EC2_IP_ADDRESS} 'bash /home/ec2-user/deploy.sh' |