Skip to content

Update main.yml

Update main.yml #30

Workflow file for this run

name: build-deploy
on:
push:
branches: [ "dev", "main" ]
pull_request:
branches: [ "dev", "main" ]
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build Docker image
run: |
mkdir -p ~/.ssh
echo "${{ secrets.PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
docker build . -f ./deploy/Dockerfile -t fivlao/sound:latest-dev
docker save fivlao/sound:latest-dev | ssh -i "~/.ssh/id_rsa" -C ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }} sudo docker load