Skip to content

🚚 cd: correct env file print syntax #17

🚚 cd: correct env file print syntax

🚚 cd: correct env file print syntax #17

Workflow file for this run

name: Continuous Delivery
on:
push:
branches:
- main
jobs:
CD:
runs-on: ubuntu-latest
steps:
- name: Checkout app
uses: actions/checkout@v4
- name: Deploy app
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}
source: "."
target: "~/smart-farming-scp"
- name: Run app
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}
script: |
cd ~/smart-farming-scp
env_file_string=$(echo ${{ secrets.ENV_FILE }})
echo $env_file_string | tr ' ' '\n' | sed 's/\([^=]\+\)=\([^ ]\+\)/\1=\2/' > ~/smart-farming-scp/.env
docker compose up -d