Skip to content

Deploy (manual)

Deploy (manual) #48

Workflow file for this run

name: Deploy (manual)
on: workflow_dispatch
jobs:
deploy-web-minusxapi-com:
runs-on: ubuntu-latest
steps:
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.PROD_SERVER_SSH_KEY }}" > ~/.ssh/id_rsa
echo "${{ secrets.PROD_SERVER_SSH_PUB_KEY }}" > ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa.pub
ssh-keyscan -H v1.minusxapi.com >> ~/.ssh/known_hosts
- name: Run frontend server (v1)
env:
REF: ${{ github.sha }} # ref to checkout
run: |
ssh [email protected] << EOF
set -e # Exit on any error
cd /home/minusx/minusx/web
git fetch --all --tags
git checkout $REF
git reset --hard $REF
docker compose up -d --build
docker image prune -f
EOF