Deploy to server via docker image #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |