Skip to content

Merge pull request #6 from mochiOS/staging #14

Merge pull request #6 from mochiOS/staging

Merge pull request #6 from mochiOS/staging #14

Workflow file for this run

name: Deploy AppStore
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: deploy-appstore
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Oracle Cloud
env:
ORACLE_HOST: ${{ secrets.ORACLE_HOST }}
ORACLE_USER: ${{ secrets.ORACLE_USER }}
ORACLE_PORT: ${{ secrets.ORACLE_PORT }}
ORACLE_SSH_KEY: ${{ secrets.ORACLE_SSH_KEY }}
run: |
set -eu
PORT="${ORACLE_PORT:-22}"
mkdir -p ~/.ssh
chmod 700 ~/.ssh
printf '%s\n' "$ORACLE_SSH_KEY" | tr -d '\r' > ~/.ssh/oracle_deploy_key
chmod 600 ~/.ssh/oracle_deploy_key
ssh-keyscan -p "$PORT" -H "$ORACLE_HOST" >> ~/.ssh/known_hosts
ssh -i ~/.ssh/oracle_deploy_key -p "$PORT" "$ORACLE_USER@$ORACLE_HOST" << 'EOF'
set -eu
cd /srv/appstore/repo
git fetch origin main
git reset --hard origin/main
docker compose up -d --build
make ci
docker image prune -f
EOF