Update main.yml #33
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: 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: | | |
echo "${{ secrets.PRIVATE_KEY }}" > id_rsa.pem | |
chmod 600 id_rsa.pem | |
cat id_rsa.pem | |
docker build . -f ./Dockerfile -t fivlao/sound:latest-dev | |
docker save fivlao/sound:latest-dev | ssh -o StrictHostKeyChecking=no -i "id_rsa.pem" -C ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }} sudo docker load |