Skip to content

Deploy all services to host #25

Deploy all services to host

Deploy all services to host #25

Workflow file for this run

name: Deploy all services to host
on:
workflow_dispatch:
inputs:
service:
description: 'Service to deploy'
required: true
default: 'all'
type: choice
options:
- all
- backend
- frontend
env:
REGISTRY: ghcr.io
jobs:
deploy:
name: Deploy to Host
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- name: Pull new images on host and restart containers
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
docker login ${{ env.REGISTRY }} -u ${{ github.actor }} -p ${{ github.token }}
docker compose pull
docker compose up -d ${{ inputs.service != 'all' && inputs.service || '' }}
docker logout ${{ env.REGISTRY }}