Files
core/.gitea/workflows/deploy.yml
Untone fed6d51af0
Some checks failed
Deploy on push / deploy (push) Failing after 5s
deploy-fix2
2025-07-25 01:17:23 +03:00

57 lines
1.2 KiB
YAML

name: Deploy to Server
on:
push:
branches:
- main
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up SSH
uses: webfactory/ssh-agent@v0.5.0
with:
ssh-private-key: ${{ secrets.SERVER_SSH_KEY }}
- name: Add server to known hosts
run: |
ssh-keyscan -H v3.dscrs.site >> ~/.ssh/known_hosts
- name: Configure Git
run: |
git config --global user.email "gitea-actions@dscrs.site"
git config --global user.name "Gitea Actions"
- name: Prepare deployment
run: |
git init
git add .
git commit -m "Prepare for deployment: $(date +'%Y-%m-%d %H:%M:%S')"
- name: Deploy to Server
env:
SERVER_HOST: v3.dscrs.site
SERVER_USER: dokku
APP_NAME: core
run: |
git remote add dokku dokku@$SERVER_HOST:$APP_NAME
git push dokku HEAD:main -f
- name: Notify Deployment
if: success()
run: |
echo "Deployment to $APP_NAME successful"
- name: Handle Deployment Failure
if: failure()
run: |
echo "Deployment failed"
exit 1