Skip to content

Commit

Permalink
Create dckr-img-delpoy-test.yml
Browse files Browse the repository at this point in the history
test to deploy docker image
  • Loading branch information
abbos1711 authored Jan 23, 2024
1 parent 58c2e1f commit bd7103e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/dckr-img-delpoy-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy to Server

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up SSH
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Install Docker
run: |
sudo apt update
sudo apt install docker.io -y
- name: Build and push Docker image
run: |
docker build -t docker-test .
docker login -u 10449 -p ${{ secrets.DOCKERHUB_TOKEN }}
docker tag docker-test 10449/docker-test
docker push 10449/docker-test
- name: SSH into server and deploy
run: |
ssh root@95.130.227.6 "docker pull 10449/docker-test && docker-compose up -d"

0 comments on commit bd7103e

Please sign in to comment.