Skip to content

Commit

Permalink
Create deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
xmppjingle committed Jan 18, 2023
1 parent bde4b82 commit ab2a14c
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS credentials
id: configure-aws-credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Start EC2 instance
id: start-ec2-instance
uses: aws-actions/ec2-instance-action@v1
with:
command: start
instance-ids: i-01234567890abcdef0
- name: SSH into EC2 instance
uses: aws-actions/ssh-action@v1
with:
host: ${{ steps.start-ec2-instance.outputs.public-ip }}
username: ubuntu
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
sudo yum install -y docker
sudo service docker start
sudo docker pull xmppjingle/banda:latest
sudo docker run --name banda -e REDIS_URL=${{ secrets.REDIS_URL }} -e AWS_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY }} -e AWS_SECRET_KEY=${{ secrets.AWS_SECRET_KEY }} -p 3000:3000 -d xmppjingle/banda:latest

0 comments on commit ab2a14c

Please sign in to comment.