Skip to content

SEO

SEO #12

Workflow file for this run

name: Deploy to EC2
on:
pull_request:
types: [closed]
workflow_dispatch:
inputs:
deploy:
description: 'Deploy to EC2?'
required: true
default: 'false'
type: choice
options:
- 'true'
- 'false'
jobs:
deploy:
runs-on: ubuntu-latest
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true') ||
(github.event_name == 'pull_request' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'deploy'))
steps:
- name: Deploy to EC2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
cd ~/geoChat/
docker compose down
docker system prune -a -f --filter "until=24h"
git pull origin main
docker compose up -d --build