2026-02-15 22:42:41 +00:00
|
|
|
name: Build and Deploy
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches:
|
|
|
|
|
- main
|
|
|
|
|
- development
|
|
|
|
|
|
2026-02-15 22:50:24 +00:00
|
|
|
env:
|
|
|
|
|
REGISTRY: forgejo.wulfconsulting.cloud
|
|
|
|
|
IMAGE: forgejo.wulfconsulting.cloud/lorentz/quest-vorteq
|
|
|
|
|
|
2026-02-15 22:42:41 +00:00
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: Determine tag
|
|
|
|
|
id: tag
|
|
|
|
|
run: |
|
|
|
|
|
if [ "${{ github.ref_name }}" = "main" ]; then
|
|
|
|
|
echo "tag=latest" >> $GITHUB_OUTPUT
|
|
|
|
|
else
|
|
|
|
|
echo "tag=dev" >> $GITHUB_OUTPUT
|
|
|
|
|
fi
|
|
|
|
|
|
2026-02-15 22:50:24 +00:00
|
|
|
- name: Login to Forgejo Registry
|
|
|
|
|
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login $REGISTRY -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
|
|
|
|
|
|
|
|
|
|
- name: Build image
|
|
|
|
|
run: docker build -t $IMAGE:${{ steps.tag.outputs.tag }} .
|
|
|
|
|
|
|
|
|
|
- name: Push image
|
|
|
|
|
run: docker push $IMAGE:${{ steps.tag.outputs.tag }}
|
2026-02-15 22:42:41 +00:00
|
|
|
|
|
|
|
|
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
|