Some checks failed
Deploy hatch.surf / build-and-deploy (push) Failing after 1m37s
- Removed .github/workflows/deploy.yml (GitHub Actions) - Added .gitea/workflows/deploy.yml (Gitea Actions) - Added setup-gitea.sh for installing Gitea - Added configure-gitea.sh for configuring Gitea - Self-hosted Git + CI/CD on local server - GitHub org only for final open-source projects Co-Authored-By: Paperclip <noreply@paperclip.ing>
39 lines
955 B
YAML
39 lines
955 B
YAML
name: Deploy hatch.surf
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
IMAGE_NAME: hatch-web
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build -t ${{ env.IMAGE_NAME }}:${{ github.sha }} .
|
|
docker tag ${{ env.IMAGE_NAME }}:${{ github.sha }} ${{ env.IMAGE_NAME }}:latest
|
|
|
|
- name: Deploy to server
|
|
uses: appleboy/ssh-action@v1
|
|
with:
|
|
host: ${{ secrets.SERVER_HOST }}
|
|
username: ${{ secrets.SERVER_USER }}
|
|
key: ${{ secrets.SERVER_SSH_KEY }}
|
|
script: |
|
|
cd /home/nara/repos/hatch-surf
|
|
git pull origin main
|
|
docker compose build
|
|
docker compose up -d --remove-orphans
|
|
docker system prune -f
|