Skip to content

Deploy to server via docker image #2

Deploy to server via docker image

Deploy to server via docker image #2

name: Deploy to server via docker image
on:
# push:
# branches: ["master"]
workflow_dispatch:
jobs:
deploy:
name: Deploy to Server manually
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: upload infrastructure files
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_SECONDARY_HOST }}
username: ${{ secrets.SSH_SECONDARY_USERNAME }}
password: ${{ secrets.SSH_SECONDARY_PASSWORD }}
port: ${{ secrets.SSH_SECONDARY_PORT }}
source: infrastructure/*
target: spybot
strip_components: 1
- name: execute remote ssh commands
uses: appleboy/ssh-action@master
env:
SECRET: ${{ secrets.ENV_FILE }}
COMMIT_SHA: ${{ github.sha }}
with:
host: ${{ secrets.SSH_SECONDARY_HOST }}
username: ${{ secrets.SSH_SECONDARY_USERNAME }}
password: ${{ secrets.SSH_SECONDARY_PASSWORD }}
port: ${{ secrets.SSH_SECONDARY_PORT }}
envs: SECRET,COMMIT_SHA
script: |
cd spybot
echo "$SECRET" > .env
docker compose -f docker-compose.yml up -d