mirror of
https://github.com/vee1e/bulk-questionnaire-upload.git
synced 2026-09-01 09:50:06 +00:00
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: deploy
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths: [backend/**, .github/workflows/deploy.yml]
|
|
workflow_dispatch:
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: docker/setup-buildx-action@v3
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./backend
|
|
file: ./backend/Dockerfile
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: ghcr.io/vee1e/bulk-questionnaire-upload:latest
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
deploy:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: appleboy/ssh-action@v1
|
|
with:
|
|
host: ${{ secrets.DEPLOY_HOST }}
|
|
username: ${{ secrets.DEPLOY_USER }}
|
|
key: ${{ secrets.DEPLOY_SSH_KEY }}
|
|
port: 7576
|
|
script: |
|
|
cd /srv/personal-apps
|
|
docker compose pull bulk
|
|
docker compose up -d --no-deps bulk
|
|
docker image prune -f
|