Skip to content

build: fix github workflow file #3

build: fix github workflow file

build: fix github workflow file #3

Workflow file for this run

name: Deploy rc-fe to staging env (azure)
on:
push:
branches:
- develop
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build the Docker image
run: |
docker build -t pawanlive/rc-fe:latest .
- name: Push the Docker image to Docker Hub
run: |
docker push pawanlive/rc-fe:latest
- name: Deploy to Azure VM
run: |
ssh -o StrictHostKeyChecking=no rheumac@${{ secrets.AZURE_VM_IP }} << 'EOF'
sudo docker pull pawanlive/rc-fe:latest
sudo docker stop rc-fe-stage || true
sudo docker rm rc-fe-stage || true
sudo docker run -d --name rc-fe-stage \
-p 3000:3000 \
pawanlive/rc-fe:latest
exit
EOF