33 lines
716 B
YAML
Executable File
33 lines
716 B
YAML
Executable File
name: Deploy to Production
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup SSH
|
|
uses: webfactory/ssh-agent@v0.7.0
|
|
with:
|
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
|
- name: Deploy to server
|
|
run: |
|
|
ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} '
|
|
cd /opt/selenium_vue &&
|
|
git pull origin main &&
|
|
./deploy.sh prod
|
|
'
|
|
|
|
- name: Health check
|
|
run: |
|
|
sleep 30
|
|
curl -f https://${{ secrets.DOMAIN_NAME }} || exit 1
|