Skip to content

Merge pull request #103 from mistralwz/master #30

Merge pull request #103 from mistralwz/master

Merge pull request #103 from mistralwz/master #30

name: production-deploy
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Run deploy on production
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script_stop: true
script: |
cd /home/akatsuki/hanayo
git fetch origin
git checkout origin/${{ steps.extract_branch.outputs.branch }}
git pull origin ${{ steps.extract_branch.outputs.branch }}
docker build -t hanayo:latest .
cd /home/akatsuki/workbench
docker-compose stop hanayo-api
docker-compose up -d hanayo-api