quest-vorteq/.forgejo/workflows/deploy.yml
Lorentz 50833b778a
Some checks failed
Build and Deploy / build (push) Failing after 56s
Build and Deploy / deploy (push) Has been skipped
Add Dockerfile and CI/CD pipeline
2026-02-15 22:42:41 +00:00

55 lines
1.4 KiB
YAML

name: Build and Deploy
on:
push:
branches:
- main
- development
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Forgejo Registry
uses: docker/login-action@v3
with:
registry: forgejo.wulfconsulting.cloud
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Determine tag
id: tag
run: |
if [ "${{ github.ref_name }}" = "main" ]; then
echo "tag=latest" >> $GITHUB_OUTPUT
else
echo "tag=dev" >> $GITHUB_OUTPUT
fi
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: forgejo.wulfconsulting.cloud/lorentz/quest-vorteq:${{ steps.tag.outputs.tag }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to server
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
script: |
cd /opt/stacks/vorteq
docker compose pull app-prod app-dev
docker compose up -d app-prod app-dev