Skip to content

feat: implement footer section (#38) #14

feat: implement footer section (#38)

feat: implement footer section (#38) #14

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
env:
SSH_PRIVATE_KEY: ${{ secrets.AZURE_VM_SSH_KEY }}
run: |
echo "$SSH_PRIVATE_KEY" > ssh_key
chmod 600 ssh_key
ssh -i ssh_key -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
rm ssh_key