Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Deploy Backend

Deploy Backend #22

Workflow file for this run

name: Deploy Backend
on:
workflow_dispatch:
inputs:
environment:
type: environment
description: Select the environment
env:
IMAGE_TAG: ${{ github.ref_name }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}
GH_PAT: ${{ secrets.PAT }}
jobs:
renew_docker_compose:
name: Rebuild Remote Docker-Compose
runs-on: ubuntu-latest
environment:
name: ${{ inputs.environment }}
steps:
- name: Connect and deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
port: 22
script: |
echo ${{ secrets.GH_PAT }} | docker login ghcr.io -u ${{ env.DOCKER_USER }} --password-stdin
cd "${{ vars.REMOTE_LOCATION }}"
./restart_service.sh "${{ vars.IMAGE_NAME }}" "${{ vars.SERVICE_NAME }}"