31 lines
635 B
YAML
31 lines
635 B
YAML
name: Build & Deploy Nuxt (Docker)
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: [self-hosted, linux, docker]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Define image tag
|
|
run: |
|
|
echo "IMAGE=local/nautilusDesk:${{ gitea.sha }}" >> $GITEA_ENV
|
|
|
|
- name: Build image
|
|
run: |
|
|
docker build -t "$IMAGE" .
|
|
|
|
- name: Deploy via compose
|
|
run: |
|
|
cd deploy
|
|
IMAGE="$IMAGE" docker compose up -d --remove-orphans
|
|
|
|
- name: Cleanup dangling images (optional)
|
|
run: |
|
|
docker image prune -f || true
|