chore: migrate CI/CD from GitLab to Gitea Actions
All checks were successful
Build and Deploy / deploy (push) Successful in 19s
All checks were successful
Build and Deploy / deploy (push) Successful in 19s
Replace .gitlab-ci.yml with .gitea/workflows/deploy.yml for build and deploy pipeline. Deploy target updated to 10.0.0.247. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
34
.gitea/workflows/deploy.yml
Normal file
34
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Build and Deploy
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build Docker image
|
||||
run: docker build -t silverlabs-website:latest -t silverlabs-website:${{ github.sha }} .
|
||||
- name: Deploy to server
|
||||
run: |
|
||||
# Install SSH tools
|
||||
apt-get update && apt-get install -y sshpass
|
||||
# Save and transfer image
|
||||
docker save silverlabs-website:latest | gzip > /tmp/silverlabs-website.tar.gz
|
||||
sshpass -p "${{ secrets.DEPLOY_PASSWORD }}" scp -o StrictHostKeyChecking=no /tmp/silverlabs-website.tar.gz sysadmin@10.0.0.247:/tmp/
|
||||
# SSH and deploy
|
||||
sshpass -p "${{ secrets.DEPLOY_PASSWORD }}" ssh -o StrictHostKeyChecking=no sysadmin@10.0.0.247 bash -s << 'EOF'
|
||||
set -e
|
||||
docker load < /tmp/silverlabs-website.tar.gz
|
||||
docker stop silverlabs-website 2>/dev/null || true
|
||||
docker rm silverlabs-website 2>/dev/null || true
|
||||
docker run -d \
|
||||
--name silverlabs-website \
|
||||
--restart unless-stopped \
|
||||
-p 8100:80 \
|
||||
silverlabs-website:latest
|
||||
docker ps | grep silverlabs-website
|
||||
rm /tmp/silverlabs-website.tar.gz
|
||||
echo "Deployment complete!"
|
||||
EOF
|
||||
Reference in New Issue
Block a user