This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
Deploy Backend #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" | |