Skip to content

action update

action update #10

Workflow file for this run

name: Deploy to Linode
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker image
run: |
docker build -t xeera/prag .
docker push xeera/prag
- name: Deploy to Linode
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.LINODE_IP }}
username: ${{ secrets.LINODE_USERNAME }}
key: ${{ secrets.LINODE_SSH_KEY }}
script: |
docker pull xeera/prag
docker stop prag || true
docker rm prag || true
docker run -d --name prag -p 443:8501 xeera/prag