Skip to content

initial commit

initial commit #1

Workflow file for this run

name: Automatic Deployment
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
env:
SSH_HOST: identicon.starknet.id
SSH_USER: ubuntu
REPO_PATH: '~/identicon.starknet.id'
steps:
- name: Setting up SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Remote deployment
run: |
ssh -o StrictHostKeyChecking=no -T $SSH_USER@$SSH_HOST << EOF
export REPO_PATH=$REPO_PATH
export GIT_SSH_COMMAND='ssh -i ~/.ssh/github_read -o IdentitiesOnly=yes'
if [ -d "\$REPO_PATH/.git" ]; then
echo "Repository exists, pulling changes..."
cd \$REPO_PATH
sudo docker compose down
git reset --hard HEAD
git pull
else
echo "Repository doesn't exist, cloning..."
mkdir -p \$REPO_PATH
git clone [email protected]:starknet-id/identicon.starknet.id.git \$REPO_PATH
cd \$REPO_PATH
fi
sudo chown -R \$SSH_USER:\$SSH_USER \$REPO_PATH
sudo chmod -R 755 \$REPO_PATH
sudo docker compose up --build -d
EOF