Skip to content

Update Caddyfile

Update Caddyfile #12

Workflow file for this run

name: Deploy Ecs
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
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.ECS_PRIVATE_KEY }}
- name: Upload files to ECS
run: |
HOST=${{ secrets.ECS_HOST }}
USER=${{ secrets.ECS_USER }}
PORT=22
scp -o StrictHostKeyChecking=no -P $PORT Caddyfile $USER@$HOST:/home/$USER/CaddyProxy/Caddyfile
scp -o StrictHostKeyChecking=no -P $PORT docker-compose.yml $USER@$HOST:/home/$USER/CaddyProxy/docker-compose.yml
- name: Deploy to ECS
run: |
HOST=${{ secrets.ECS_HOST }}
USER=${{ secrets.ECS_USER }}
PORT=22
ssh -o StrictHostKeyChecking=no $USER@$HOST << 'EOF'
docker compose -f /home/$USER/CaddyProxy/docker-compose.yml down
docker compose -f /home/$USER/CaddyProxy/docker-compose.yml up -d
EOF