fix: DockerSecretsResolver - don't normalize absolute paths like /var/www/html/...
Some checks failed
Deploy Application / deploy (push) Has been cancelled
Some checks failed
Deploy Application / deploy (push) Has been cancelled
This commit is contained in:
60
.gitea/workflows/deploy.yml
Normal file
60
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Deploy Application
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- staging
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Determine environment
|
||||
id: env
|
||||
run: |
|
||||
if [ "${{ github.ref }}" == "refs/heads/staging" ]; then
|
||||
echo "environment=staging" >> $GITHUB_OUTPUT
|
||||
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
||||
echo "environment=production" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "environment=staging" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Deploy to server
|
||||
env:
|
||||
SSH_HOST: ${{ secrets.SSH_HOST }}
|
||||
SSH_USER: ${{ secrets.SSH_USER }}
|
||||
SSH_KEY: ${{ secrets.SSH_KEY }}
|
||||
run: |
|
||||
echo "$SSH_KEY" > /tmp/ssh_key
|
||||
chmod 600 /tmp/ssh_key
|
||||
|
||||
ssh -i /tmp/ssh_key -o StrictHostKeyChecking=no $SSH_USER@$SSH_HOST << EOF
|
||||
set -e
|
||||
cd /home/deploy/michaelschiemer/current
|
||||
|
||||
# Pull latest code
|
||||
git fetch origin ${{ github.ref_name }}
|
||||
git reset --hard origin/${{ github.ref_name }}
|
||||
|
||||
# Run deployment script
|
||||
./deployment/scripts/deploy.sh ${{ steps.env.outputs.environment }}
|
||||
EOF
|
||||
|
||||
rm -f /tmp/ssh_key
|
||||
|
||||
- name: Deployment status
|
||||
if: always()
|
||||
run: |
|
||||
if [ "${{ job.status }}" == "success" ]; then
|
||||
echo "✅ Deployment successful"
|
||||
else
|
||||
echo "❌ Deployment failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user