Skip to content

refactor: throw character name is empty on response from maple #46

refactor: throw character name is empty on response from maple

refactor: throw character name is empty on response from maple #46

Workflow file for this run

name: Frontend Deploy
on:
workflow_dispatch:
push:
branches:
- main
paths:
- frontend/**
- .github/workflows/fe-cd.yaml
- server/docker/docker-compose-fe.yaml
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nodejs 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install modules
working-directory: frontend
run: npm ci
- name: Build
working-directory: frontend
run: npm run build
- name: Copy dist
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
source: frontend/dist/, server/docker/
target: ~/${{ github.event.repository.name }}
- name: Update fe
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
cd ~/${{ github.event.repository.name }}/server/docker
docker compose -f docker-compose-fe.yaml pull
REPO_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')
docker service ls | grep -iw ${REPO_NAME}_fe \
&& docker service update --force ${REPO_NAME}_fe \
|| docker stack deploy -c docker-compose-fe.yaml ${REPO_NAME}
docker image prune -af
STATUS=$(docker service inspect ${REPO_NAME}_fe --format {{.UpdateStatus.State}})
if [[ ${STATUS} != "completed" ]]; then
exit 1
fi