Skip to content

Commit

Permalink
Create deploy-on-master-push.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
heatherbaier authored Mar 19, 2024
1 parent 28725cc commit 5ace04d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy-on-master-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Deploy on Master Push

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setting up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_aws.pem
chmod 600 ~/.ssh/id_aws.pem
ssh-keyscan -H ec2-34-224-89-239.compute-1.amazonaws.com >> ~/.ssh/known_hosts
- name: Connect to EC2 and run script
run: ssh -i "~/.ssh/id_aws.pem" [email protected] 'bash -s' < /home/ubuntu/scripts/hello.sh

0 comments on commit 5ace04d

Please sign in to comment.