Skip to content

add sudo

add sudo #3

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- withDocker
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Deploy
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: SSH to server and pull Docker image and run docker-compose up
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} << EOF
cd layered-elysia
git checkout withDocker
git pull
sudo docker compose build
sudo docker compose down
sudo docker compose up -d
EOF