All checks were successful
Gitea build & Test. / tests (pull_request) Successful in 6s
35 lines
788 B
YAML
35 lines
788 B
YAML
name: Deploy to production
|
|
run-name: deploy-${{ gitea.actor }}
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup SSH
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
|
|
chmod 600 ~/.ssh/id_rsa
|
|
ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
|
|
|
|
- name: Deploy
|
|
run: |
|
|
ssh -i ~/.ssh/id_rsa ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} << 'EOF'
|
|
cd /path/to/Quatsh-Website
|
|
|
|
echo "Pulling latest code..."
|
|
git pull origin main
|
|
|
|
echo "Building containers..."
|
|
make prod
|
|
|
|
echo "Deployment complete."
|
|
EOF |